Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
[Loading ML file ring_plugin.cmxs (using legacy method) ... done]
[Loading ML file zify_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_plugin.cmxs (using legacy method) ... done]
[Loading ML file btauto_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssrmatching_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssreflect_plugin.cmxs (using legacy method) ... done]
From Generated Require Import DisjointSetUnion. From stdpp Require Import numbers list. Require Import Coq.Logic.FunctionalExtensionality. Require Import Wellfounded. Definition state : BlockchainState := fun address => if decide (address = repeat (0%Z) 20) then BlockchainContract arrayIndex0 _ (arrayType _ environment0) (arrays _ environment0) 100000%Z (funcdef_0__main (fun x => false) (fun x => 0%Z) (fun x => repeat 0%Z 20)) else ExternallyOwned 0%Z. Definition stateAfterInteractions arrays money : BlockchainState := fun address => if decide (address = repeat (0%Z) 20) then BlockchainContract arrayIndex0 _ (arrayType _ environment0) arrays (100000%Z - money) (funcdef_0__main (fun x => false) (fun x => 0%Z) (fun x => repeat 0%Z 20)) else if decide (address = repeat (1%Z) 20) then ExternallyOwned money else ExternallyOwned 0%Z. Fixpoint interact (state : BlockchainState) (interactions : list (Z * Z)) := match interactions with | [] => getBalance (state (repeat 1%Z 20)) | (a, b) :: tail => match invokeContract (repeat 1%Z 20) (repeat 0%Z 20) 0%Z state state [a; b] 1 with | Some (_, changedState) => interact changedState tail | None => 0%Z end end. Definition optimalInteractions (x : list (Z * Z)) := forall x', Z.le (interact state x') (interact state x). Inductive Slot := | ReferTo (x : nat) | Ancestor (x : Tree). Definition noIllegalIndices (dsu : list Slot) := forall x y, nth x dsu (Ancestor Unit) = ReferTo y -> y < length dsu. Fixpoint convertToArray (x : list Slot) : list Z := match x with | [] => [] | (ReferTo x) :: tail => (Z.of_nat x) :: convertToArray tail | (Ancestor x) :: tail => (Z.sub 256%Z (Z.of_nat (leafCount x))) :: convertToArray tail end.
x: list Slot
n: nat
hN: n < length x

nth n (convertToArray x) 0%Z = match nth n x (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
x: list Slot
n: nat
hN: n < length x

nth n (convertToArray x) 0%Z = match nth n x (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
x: list Slot

_0 : nat, _0 < length x → nth _0 (convertToArray x) 0%Z = match nth _0 x (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: n < length []

nth n (convertToArray []) 0%Z = match nth n [] (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: n < length (head :: tail)
nth n (convertToArray (head :: tail)) 0%Z = match nth n (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
n: nat
hN: n < length []

nth n (convertToArray []) 0%Z = match nth n [] (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
n: nat
hN: n < 0

nth n (convertToArray []) 0%Z = match nth n [] (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
lia.
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: n < length (head :: tail)

nth n (convertToArray (head :: tail)) 0%Z = match nth n (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
hN: 0 < length (head :: tail)

nth 0 (convertToArray (head :: tail)) 0%Z = match nth 0 (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: S n < length (head :: tail)
nth (S n) (convertToArray (head :: tail)) 0%Z = match nth (S n) (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
hN: 0 < length (head :: tail)

nth 0 (convertToArray (head :: tail)) 0%Z = match nth 0 (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
hN: 0 < length (head :: tail)

nth 0 match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray tail end 0%Z = match head with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
destruct head; reflexivity.
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: S n < length (head :: tail)

nth (S n) (convertToArray (head :: tail)) 0%Z = match nth (S n) (head :: tail) (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: S n < length (head :: tail)

nth n (convertToArray tail) 0%Z = match nth n tail (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: S n < length (head :: tail)

n < length tail
head: Slot
tail: list Slot
IH: _0 : nat, _0 < length tail → nth _0 (convertToArray tail) 0%Z = match nth _0 tail (Ancestor Unit) with | ReferTo _1 => Z.of_nat _1 | Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z end
n: nat
hN: S n < S (length tail)

n < length tail
lia. Qed.
x: list Slot
n: nat
hN: n < length x
v: Z
hU: (0 ≤ v)%Z

<[n:=v]> (convertToArray x) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> x)
x: list Slot
n: nat
hN: n < length x
v: Z
hU: (0 ≤ v)%Z

<[n:=v]> (convertToArray x) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> x)
x: list Slot
v: Z
hU: (0 ≤ v)%Z

_0 : nat, _0 < length x → <[_0:=v]> (convertToArray x) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> x)
v: Z
hU: (0 ≤ v)%Z
n: nat
hN: n < length []

<[n:=v]> (convertToArray []) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> [])
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
n: nat
hN: n < length (head :: tail)
<[n:=v]> (convertToArray (head :: tail)) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> (head :: tail))
v: Z
hU: (0 ≤ v)%Z
n: nat
hN: n < length []

<[n:=v]> (convertToArray []) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> [])
v: Z
hU: (0 ≤ v)%Z
n: nat
hN: n < 0

<[n:=v]> (convertToArray []) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> [])
lia.
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
n: nat
hN: n < length (head :: tail)

<[n:=v]> (convertToArray (head :: tail)) = convertToArray (<[n:=ReferTo (Z.to_nat v)]> (head :: tail))
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
hN: 0 < length (head :: tail)

<[0:=v]> (convertToArray (head :: tail)) = convertToArray (<[0:=ReferTo (Z.to_nat v)]> (head :: tail))
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
n: nat
hN: S n < length (head :: tail)
<[S n:=v]> (convertToArray (head :: tail)) = convertToArray (<[S n:=ReferTo (Z.to_nat v)]> (head :: tail))
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
hN: 0 < length (head :: tail)

<[0:=v]> (convertToArray (head :: tail)) = convertToArray (<[0:=ReferTo (Z.to_nat v)]> (head :: tail))
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
hN: 0 < length (head :: tail)

<[0:=v]> match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray tail end = Z.of_nat (Z.to_nat v) :: convertToArray tail
destruct head; simpl; rewrite Z2Nat.id; try lia; reflexivity.
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
n: nat
hN: S n < length (head :: tail)

<[S n:=v]> (convertToArray (head :: tail)) = convertToArray (<[S n:=ReferTo (Z.to_nat v)]> (head :: tail))
head: Slot
tail: list Slot
v: Z
hU: (0 ≤ v)%Z
IH: _0 : nat, _0 < length tail → <[_0:=v]> (convertToArray tail) = convertToArray (<[_0:=ReferTo (Z.to_nat v)]> tail)
n: nat
hN: S n < length (head :: tail)

<[S n:=v]> match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray tail end = match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray (<[n:=ReferTo (Z.to_nat v)]> tail) | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray (<[n:=ReferTo (Z.to_nat v)]> tail) end
destruct head; simpl; rewrite IH; try reflexivity; simpl in hN; lia. Qed.
x: list Slot
n: nat
hN: n < length x
v: Tree

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray x) = convertToArray (<[n:=Ancestor v]> x)
x: list Slot
n: nat
hN: n < length x
v: Tree

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray x) = convertToArray (<[n:=Ancestor v]> x)
x: list Slot
v: Tree

_0 : nat, _0 < length x → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray x) = convertToArray (<[_0:=Ancestor v]> x)
v: Tree
n: nat
hN: n < length []

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray []) = convertToArray (<[n:=Ancestor v]> [])
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
n: nat
hN: n < length (head :: tail)
<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[n:=Ancestor v]> (head :: tail))
v: Tree
n: nat
hN: n < length []

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray []) = convertToArray (<[n:=Ancestor v]> [])
v: Tree
n: nat
hN: n < 0

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray []) = convertToArray (<[n:=Ancestor v]> [])
lia.
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
n: nat
hN: n < length (head :: tail)

<[n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[n:=Ancestor v]> (head :: tail))
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
hN: 0 < length (head :: tail)

<[0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[0:=Ancestor v]> (head :: tail))
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
n: nat
hN: S n < length (head :: tail)
<[S n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[S n:=Ancestor v]> (head :: tail))
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
hN: 0 < length (head :: tail)

<[0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[0:=Ancestor v]> (head :: tail))
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
hN: 0 < length (head :: tail)

<[0:=(256 - Z.of_nat (leafCount v))%Z]> match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray tail end = (256 - Z.of_nat (leafCount v))%Z :: convertToArray tail
destruct head; simpl; reflexivity.
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
n: nat
hN: S n < length (head :: tail)

<[S n:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray (head :: tail)) = convertToArray (<[S n:=Ancestor v]> (head :: tail))
head: Slot
tail: list Slot
v: Tree
IH: _0 : nat, _0 < length tail → <[_0:=(256 - Z.of_nat (leafCount v))%Z]> (convertToArray tail) = convertToArray (<[_0:=Ancestor v]> tail)
n: nat
hN: S n < length (head :: tail)

<[S n:=(256 - Z.of_nat (leafCount v))%Z]> match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray tail end = match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray (<[n:=Ancestor v]> tail) | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z :: convertToArray (<[n:=Ancestor v]> tail) end
destruct head; simpl; rewrite IH; try reflexivity; simpl in hN; lia. Qed.
dsu: list Slot

length (convertToArray dsu) = length dsu
dsu: list Slot

length (convertToArray dsu) = length dsu
induction dsu as [| [|] tail IH]; [easy | |]; simpl; now rewrite IH. Qed.
dsu: list Slot
h: length dsu < 256
h1: _0 _1 : nat, nth _0 dsu (Ancestor Unit) = ReferTo _1 → _1 < 256
n: nat

(nth n (convertToArray dsu) 0 < 256)%Z
dsu: list Slot
h: length dsu < 256
h1: _0 _1 : nat, nth _0 dsu (Ancestor Unit) = ReferTo _1 → _1 < 256
n: nat

(nth n (convertToArray dsu) 0 < 256)%Z
dsu: list Slot
h: length dsu < 256
h1: _0 _1 : nat, nth _0 dsu (Ancestor Unit) = ReferTo _1 → _1 < 256

_0 : nat, (nth _0 (convertToArray dsu) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z

(nth 0 (convertToArray (ReferTo a :: tail)) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat
(nth (S n) (convertToArray (ReferTo a :: tail)) 0 < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
(nth 0 (convertToArray (Ancestor a :: tail)) 0 < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat
(nth (S n) (convertToArray (Ancestor a :: tail)) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z

(nth 0 (convertToArray (ReferTo a :: tail)) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z

(Z.of_nat a < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
_0: a < 256

(Z.of_nat a < 256)%Z
lia.
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

(nth (S n) (convertToArray (ReferTo a :: tail)) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

(nth n (convertToArray tail) 0 < 256)%Z
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

length tail < 256
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat
_0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

length tail < 256
simpl in h; lia.
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

_0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat

nth s tail (Ancestor Unit) = ReferTo t → t < 256
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat
step: nth (S s) (ReferTo a :: tail) (Ancestor Unit) = ReferTo t → t < 256

nth s tail (Ancestor Unit) = ReferTo t → t < 256
a: nat
tail: list Slot
h: length (ReferTo a :: tail) < 256
h1: _0 _1 : nat, nth _0 (ReferTo a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat
step: nth s tail (Ancestor Unit) = ReferTo t → t < 256

nth s tail (Ancestor Unit) = ReferTo t → t < 256
exact step.
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z

(nth 0 (convertToArray (Ancestor a :: tail)) 0 < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z

(256 - Z.of_nat (leafCount a) < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
_0: 1 ≤ leafCount a

(256 - Z.of_nat (leafCount a) < 256)%Z
lia.
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

(nth (S n) (convertToArray (Ancestor a :: tail)) 0 < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

(nth n (convertToArray tail) 0 < 256)%Z
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

length tail < 256
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat
_0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

length tail < 256
simpl in h; lia.
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n: nat

_0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat

nth s tail (Ancestor Unit) = ReferTo t → t < 256
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat
step: nth (S s) (Ancestor a :: tail) (Ancestor Unit) = ReferTo t → t < 256

nth s tail (Ancestor Unit) = ReferTo t → t < 256
a: Tree
tail: list Slot
h: length (Ancestor a :: tail) < 256
h1: _0 _1 : nat, nth _0 (Ancestor a :: tail) (Ancestor Unit) = ReferTo _1 → _1 < 256
IH: length tail < 256 → ( _0 _1 : nat, nth _0 tail (Ancestor Unit) = ReferTo _1 → _1 < 256) → _0 : nat, (nth _0 (convertToArray tail) 0 < 256)%Z
n, s, t: nat
step: nth s tail (Ancestor Unit) = ReferTo t → t < 256

nth s tail (Ancestor Unit) = ReferTo t → t < 256
exact step. Qed.
dsu: list Slot
h: length dsu < 256
h1: noIllegalIndices dsu
n: nat

(nth n (convertToArray dsu) 0 < 256)%Z
dsu: list Slot
h: length dsu < 256
h1: noIllegalIndices dsu
n: nat

(nth n (convertToArray dsu) 0 < 256)%Z
dsu: list Slot
h: length dsu < 256
h1: noIllegalIndices dsu
n: nat

_0 _1 : nat, nth _0 dsu (Ancestor Unit) = ReferTo _1 → _1 < 256
dsu: list Slot
h: length dsu < 256
h1: noIllegalIndices dsu
n, a, b: nat
c: nth a dsu (Ancestor Unit) = ReferTo b

b < 256
dsu: list Slot
h: length dsu < 256
h1: noIllegalIndices dsu
n, a, b: nat
c: nth a dsu (Ancestor Unit) = ReferTo b
_0: b < length dsu

b < 256
lia. Qed. Definition dsuScore (dsu : list Slot) := Z.of_nat (list_sum (map (fun x => match x with | ReferTo _ => 0 | Ancestor x => score x end) dsu)). Definition dsuLeafCount (dsu : list Slot) := Z.of_nat (list_sum (map (fun x => match x with | ReferTo _ => 0 | Ancestor x => leafCount x end) dsu)).
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
step: dsu = take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
step: dsu = take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount (take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu))
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
step: dsu = take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu

leafCount u + leafCount v ≤ Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu))))
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
step: dsu = take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu

leafCount u + leafCount v ≤ list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor u]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S a) (take b dsu))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor v]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (b + 1) dsu)))))
dsu: list Slot
a, b: nat
hAB: a < b
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
step: dsu = take a dsu ++ [nth a dsu (Ancestor Unit)] ++ drop (S a) (take b dsu) ++ [nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu

leafCount u + leafCount v ≤ list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + (leafCount u + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S a) (take b dsu))) + (leafCount v + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (b + 1) dsu)))))
lia. Qed.
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
hs: a < b

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
hs: b < a
leafCount v + leafCount u ≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
hs: a < b

leafCount u + leafCount v ≤ Z.to_nat (dsuLeafCount dsu)
apply (sumTwoAncestors' _ a b); assumption.
dsu: list Slot
a, b: nat
hAB: a ≠ b
hA: a < length dsu
hB: b < length dsu
u: Tree
hA1: nth a dsu (Ancestor Unit) = Ancestor u
v: Tree
hB1: nth b dsu (Ancestor Unit) = Ancestor v
hs: b < a

leafCount v + leafCount u ≤ Z.to_nat (dsuLeafCount dsu)
apply (sumTwoAncestors' _ b a); assumption. Qed.
dsu: list Slot
h: length dsu < 256
h1: Z.to_nat (dsuLeafCount dsu) < 128
n: nat
hn: n < length dsu
x: Tree
h2: nth n dsu (Ancestor Unit) = Ancestor x

leafCount x < 128
dsu: list Slot
h: length dsu < 256
h1: Z.to_nat (dsuLeafCount dsu) < 128
n: nat
hn: n < length dsu
x: Tree
h2: nth n dsu (Ancestor Unit) = Ancestor x

leafCount x < 128
dsu: list Slot
h: length dsu < 256
h1: Z.to_nat (dsuLeafCount dsu) < 128

_0 : nat, _0 < length dsu → _1 : Tree, nth _0 dsu (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h: length [] < 256
h1: Z.to_nat (dsuLeafCount []) < 128

_0 : nat, _0 < length [] → _1 : Tree, nth _0 [] (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
_0 : nat, _0 < length (head :: tail) → _1 : Tree, nth _0 (head :: tail) (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h: length [] < 256
h1: Z.to_nat (dsuLeafCount []) < 128

_0 : nat, _0 < length [] → _1 : Tree, nth _0 [] (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h: length [] < 256
h1: Z.to_nat (dsuLeafCount []) < 128

_0 : nat, _0 < 0 _1 : Tree, match _0 with | 0 | _ => Ancestor Unit end = Ancestor _1 → leafCount _1 < 128
h: length [] < 256
h1: Z.to_nat (dsuLeafCount []) < 128
_0: nat

_0 < 0 _1 : Tree, match _0 with | 0 | _ => Ancestor Unit end = Ancestor _1 → leafCount _1 < 128
lia.
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128

_0 : nat, _0 < length (head :: tail) → _1 : Tree, nth _0 (head :: tail) (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
n: nat
h2: n < length (head :: tail)
h3: Tree
h4: nth n (head :: tail) (Ancestor Unit) = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h3: Tree
h4: nth 0 (head :: tail) (Ancestor Unit) = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
n: nat
h2: S n < length (head :: tail)
h3: Tree
h4: nth (S n) (head :: tail) (Ancestor Unit) = Ancestor h3
leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h3: Tree
h4: nth 0 (head :: tail) (Ancestor Unit) = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h3: Tree
h4: head = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (head :: tail)))) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h3: Tree
h4: head = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: match head with | ReferTo _ => 0 | Ancestor _0 => leafCount _0 end + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h3: Tree
h4: head = Ancestor h3

leafCount h3 < 128
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h3: Tree
h1: leafCount h3 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
h2: 0 < length (head :: tail)
h4: head = Ancestor h3

leafCount h3 < 128
lia.
head: Slot
tail: list Slot
h: length (head :: tail) < 256
h1: Z.to_nat (dsuLeafCount (head :: tail)) < 128
IH: length tail < 256 → Z.to_nat (dsuLeafCount tail) < 128 _0 : nat, _0 < length tail → _1 : Tree, nth _0 tail (Ancestor Unit) = Ancestor _1 → leafCount _1 < 128
n: nat
h2: S n < length (head :: tail)
h3: Tree
h4: nth (S n) (head :: tail) (Ancestor Unit) = Ancestor h3

leafCount h3 < 128
exact (IH ltac:(simpl in h; lia) ltac:(unfold dsuLeafCount in h1; rewrite Nat2Z.id in h1; rewrite -> map_cons, (ltac:(simpl; reflexivity) : list_sum (_ :: _) = _ + list_sum _) in h1; unfold dsuLeafCount; rewrite Nat2Z.id; lia) n ltac:(simpl in h2; lia) h3 ltac:(simpl in h4; exact h4)). Qed.
dsu: list Slot
h: length dsu < 256
h1: Z.to_nat (dsuLeafCount dsu) < 128
n: nat

(0 ≤ nth n (convertToArray dsu) 0)%Z
dsu: list Slot
h: length dsu < 256
h1: Z.to_nat (dsuLeafCount dsu) < 128
n: nat

(0 ≤ nth n (convertToArray dsu) 0)%Z
dsu: list Slot
h: length dsu < 256

_0 : nat, Z.to_nat (dsuLeafCount dsu) < 128 → (0 ≤ nth _0 (convertToArray dsu) 0)%Z
h: length [] < 256

_0 : nat, Z.to_nat (dsuLeafCount []) < 128 → (0 ≤ nth _0 (convertToArray []) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
_0 : nat, Z.to_nat (dsuLeafCount (head :: tail)) < 128 → (0 ≤ nth _0 (convertToArray (head :: tail)) 0)%Z
h: length [] < 256

_0 : nat, Z.to_nat (dsuLeafCount []) < 128 → (0 ≤ nth _0 (convertToArray []) 0)%Z
h: length [] < 256

_0 : nat, 1128match match _0 with | 0 | _ => 0%Z end with | 0%Z => Eq | Z.pos _ => Lt | Z.neg _ => Gt end = Gt → False
h: length [] < 256
a: nat
b: 1128

match match a with | 0 | _ => 0%Z end with | 0%Z => Eq | Z.pos _ => Lt | Z.neg _ => Gt end = Gt → False
destruct a; easy.
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z

_0 : nat, Z.to_nat (dsuLeafCount (head :: tail)) < 128 → (0 ≤ nth _0 (convertToArray (head :: tail)) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128

(0 ≤ nth 0 (convertToArray (head :: tail)) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
a: nat
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128
(0 ≤ nth (S a) (convertToArray (head :: tail)) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128

(0 ≤ nth 0 (convertToArray (head :: tail)) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128

(0 ≤ nth 0 match head with | ReferTo _0 => Z.of_nat _0 :: convertToArray tail | Ancestor _0 => 256 - Z.of_nat (leafCount _0) :: convertToArray tail end 0)%Z
x: nat
tail: list Slot
h: length (ReferTo x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (ReferTo x :: tail)) < 128

(0 ≤ nth 0 (Z.of_nat x :: convertToArray tail) 0)%Z
x: Tree
tail: list Slot
h: length (Ancestor x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (Ancestor x :: tail)) < 128
(0 ≤ nth 0 (256 - Z.of_nat (leafCount x) :: convertToArray tail) 0)%Z
x: nat
tail: list Slot
h: length (ReferTo x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (ReferTo x :: tail)) < 128

(0 ≤ nth 0 (Z.of_nat x :: convertToArray tail) 0)%Z
x: nat
tail: list Slot
h: length (ReferTo x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (ReferTo x :: tail)) < 128

(0 ≤ Z.of_nat x)%Z
lia.
x: Tree
tail: list Slot
h: length (Ancestor x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (Ancestor x :: tail)) < 128

(0 ≤ nth 0 (256 - Z.of_nat (leafCount x) :: convertToArray tail) 0)%Z
x: Tree
tail: list Slot
h: length (Ancestor x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (dsuLeafCount (Ancestor x :: tail)) < 128

(0256 - Z.of_nat (leafCount x))%Z
x: Tree
tail: list Slot
h: length (Ancestor x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (Ancestor x :: tail)))) < 128

(0256 - Z.of_nat (leafCount x))%Z
x: Tree
tail: list Slot
h: length (Ancestor x :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
b: leafCount x + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) < 128

(0256 - Z.of_nat (leafCount x))%Z
lia.
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
a: nat
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128

(0 ≤ nth (S a) (convertToArray (head :: tail)) 0)%Z
head: Slot
tail: list Slot
h: length (head :: tail) < 256
IH: length tail < 256 _0 : nat, Z.to_nat (dsuLeafCount tail) < 128 → (0 ≤ nth _0 (convertToArray tail) 0)%Z
a: nat
b: Z.to_nat (dsuLeafCount (head :: tail)) < 128

(0 ≤ nth a (convertToArray tail) 0)%Z
exact (IH ltac:(simpl in h; lia) a ltac:(unfold dsuLeafCount in b; rewrite -> Nat2Z.id, map_cons, (ltac:(simpl; reflexivity) : list_sum (_ :: _) = _ + list_sum _) in b; unfold dsuLeafCount; rewrite Nat2Z.id; lia)). Qed.
dsu: list Slot
h: length dsu < 128
h1: Z.to_nat (dsuLeafCount dsu) = length dsu
n: nat

(0 ≤ nth n (convertToArray dsu) 0)%Z
dsu: list Slot
h: length dsu < 128
h1: Z.to_nat (dsuLeafCount dsu) = length dsu
n: nat

(0 ≤ nth n (convertToArray dsu) 0)%Z
apply nthLowerBoundConvertAux; try (assumption || lia). Qed. Fixpoint ancestor (dsu : list Slot) (fuel : nat) (index : nat) := match fuel with | O => index | S fuel => match nth index dsu (Ancestor Unit) with | ReferTo x => ancestor dsu fuel x | Ancestor _ => index end end. Fixpoint ancestorChain (dsu : list Slot) (fuel : nat) (index : nat) := match fuel with | O => [index] | S fuel => match nth index dsu (Ancestor Unit) with | ReferTo x => index :: ancestorChain dsu fuel x | Ancestor _ => index :: nil end end.
dsu: list Slot
fuel, index: nat

nth 0 (ancestorChain dsu fuel index) 0 = index
dsu: list Slot
fuel, index: nat

nth 0 (ancestorChain dsu fuel index) 0 = index
dsu: list Slot
index: nat

nth 0 (ancestorChain dsu 0 index) 0 = index
dsu: list Slot
fuel, index: nat
nth 0 (ancestorChain dsu (S fuel) index) 0 = index
dsu: list Slot
index: nat

nth 0 (ancestorChain dsu 0 index) 0 = index
easy.
dsu: list Slot
fuel, index: nat

nth 0 (ancestorChain dsu (S fuel) index) 0 = index
dsu: list Slot
fuel, index: nat

nth 0 match nth index dsu (Ancestor Unit) with | ReferTo _0 => index :: ancestorChain dsu fuel _0 | Ancestor _ => [index] end 0 = index
destruct (nth index _ _); easy. Qed.
dsu: list Slot
fuel, index: nat

0 < length (ancestorChain dsu fuel index)
dsu: list Slot
fuel, index: nat

0 < length (ancestorChain dsu fuel index)
dsu: list Slot
index: nat

0 < length (ancestorChain dsu 0 index)
dsu: list Slot
fuel, index: nat
0 < length (ancestorChain dsu (S fuel) index)
dsu: list Slot
index: nat

0 < length (ancestorChain dsu 0 index)
dsu: list Slot
index: nat

0 < 1
lia.
dsu: list Slot
fuel, index: nat

0 < length (ancestorChain dsu (S fuel) index)
dsu: list Slot
fuel, index: nat

0 < length match nth index dsu (Ancestor Unit) with | ReferTo _0 => index :: ancestorChain dsu fuel _0 | Ancestor _ => [index] end
destruct (nth index _ _); cbv; lia. Qed.
dsu: list Slot
fuel, index: nat

last (ancestorChain dsu fuel index) = Some (ancestor dsu fuel index)
dsu: list Slot
fuel, index: nat

last (ancestorChain dsu fuel index) = Some (ancestor dsu fuel index)
dsu: list Slot
index: nat

last (ancestorChain dsu 0 index) = Some (ancestor dsu 0 index)
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
last (ancestorChain dsu (S fuel) index) = Some (ancestor dsu (S fuel) index)
dsu: list Slot
index: nat

last (ancestorChain dsu 0 index) = Some (ancestor dsu 0 index)
easy.
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)

last (ancestorChain dsu (S fuel) index) = Some (ancestor dsu (S fuel) index)
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)

last match nth index dsu (Ancestor Unit) with | ReferTo _0 => index :: ancestorChain dsu fuel _0 | Ancestor _ => [index] end = Some match nth index dsu (Ancestor Unit) with | ReferTo _0 => ancestor dsu fuel _0 | Ancestor _ => index end
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: Slot
hX: x = nth index dsu (Ancestor Unit)

last match x with | ReferTo _0 => index :: ancestorChain dsu fuel _0 | Ancestor _ => [index] end = Some match x with | ReferTo _0 => ancestor dsu fuel _0 | Ancestor _ => index end
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x

last (index :: ancestorChain dsu fuel x) = Some (ancestor dsu fuel x)
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: Tree
hX: nth index dsu (Ancestor Unit) = Ancestor x
last [index] = Some index
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x

last (index :: ancestorChain dsu fuel x) = Some (ancestor dsu fuel x)
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x

match last (ancestorChain dsu fuel x) with | Some _0 => Some _0 | None => Some index end = Some (ancestor dsu fuel x)
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x
h: last (ancestorChain dsu fuel x) = Some (ancestor dsu fuel x)

match last (ancestorChain dsu fuel x) with | Some _0 => Some _0 | None => Some index end = Some (ancestor dsu fuel x)
now rewrite h.
dsu: list Slot
fuel, index: nat
IH: _0 : nat, last (ancestorChain dsu fuel _0) = Some (ancestor dsu fuel _0)
x: Tree
hX: nth index dsu (Ancestor Unit) = Ancestor x

last [index] = Some index
easy. Qed.
A: Type
l: list A
d: A

default d (last l) = nth (length l - 1) l d
A: Type
l: list A
d: A

default d (last l) = nth (length l - 1) l d
A: Type
d: A

default d (last []) = nth (length [] - 1) [] d
A: Type
head: A
tail: list A
d: A
IH: default d (last tail) = nth (length tail - 1) tail d
default d (last (head :: tail)) = nth (length (head :: tail) - 1) (head :: tail) d
A: Type
d: A

default d (last []) = nth (length [] - 1) [] d
easy.
A: Type
head: A
tail: list A
d: A
IH: default d (last tail) = nth (length tail - 1) tail d

default d (last (head :: tail)) = nth (length (head :: tail) - 1) (head :: tail) d
A: Type
head: A
tail: list A
d: A
IH: default d (last tail) = nth (length tail - 1) tail d

default d (last (head :: tail)) = match length tail - 0 with | 0 => head | S _0 => nth _0 tail d end
A: Type
head: A
tail: list A
d: A
IH: default d (last tail) = nth (length tail - 1) tail d

default d match last tail with | Some _0 => Some _0 | None => Some head end = match length tail - 0 with | 0 => head | S _0 => nth _0 tail d end
A: Type
head: A
tail: list A
d: A
IH: default d (last tail) = nth (length tail - 1) tail d

default d match last tail with | Some _0 => Some _0 | None => Some head end = match length tail with | 0 => head | S _0 => nth _0 tail d end
A: Type
head, d: A
IH: default d (last []) = nth (length [] - 1) [] d

default d match last [] with | Some _0 => Some _0 | None => Some head end = match length [] with | 0 => head | S _0 => nth _0 [] d end
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length (head' :: tail') - 1) (head' :: tail') d
default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = match length (head' :: tail') with | 0 => head | S _0 => nth _0 (head' :: tail') d end
A: Type
head, d: A
IH: default d (last []) = nth (length [] - 1) [] d

default d match last [] with | Some _0 => Some _0 | None => Some head end = match length [] with | 0 => head | S _0 => nth _0 [] d end
easy.
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length (head' :: tail') - 1) (head' :: tail') d

default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = match length (head' :: tail') with | 0 => head | S _0 => nth _0 (head' :: tail') d end
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (S (length tail') - 1) (head' :: tail') d

default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = nth (length tail') (head' :: tail') d
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d

default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = nth (length tail') (head' :: tail') d
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d

default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = default d (last (head' :: tail'))
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d

last (head' :: tail') ≠ None
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d
h: last (head' :: tail') ≠ None
default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = default d (last (head' :: tail'))
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d

last (head' :: tail') ≠ None
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d

match last tail' with | Some _0 => Some _0 | None => Some head' end ≠ None
destruct (last tail'); easy.
A: Type
head, head': A
tail': list A
d: A
IH: default d (last (head' :: tail')) = nth (length tail') (head' :: tail') d
h: last (head' :: tail') ≠ None

default d match last (head' :: tail') with | Some _0 => Some _0 | None => Some head end = default d (last (head' :: tail'))
A: Type
head, head': A
tail': list A
d, x: A
IH: default d (Some x) = nth (length tail') (head' :: tail') d
h: Some x ≠ None

default d (Some x) = default d (Some x)
A: Type
head, head': A
tail': list A
d: A
IH: default d None = nth (length tail') (head' :: tail') d
h: None ≠ None
default d (Some head) = default d None
A: Type
head, head': A
tail': list A
d, x: A
IH: default d (Some x) = nth (length tail') (head' :: tail') d
h: Some x ≠ None

default d (Some x) = default d (Some x)
reflexivity.
A: Type
head, head': A
tail': list A
d: A
IH: default d None = nth (length tail') (head' :: tail') d
h: None ≠ None

default d (Some head) = default d None
easy. Qed.
dsu: list Slot
fuel, index: nat

nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0 = ancestor dsu fuel index
dsu: list Slot
fuel, index: nat

nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0 = ancestor dsu fuel index
dsu: list Slot
fuel, index: nat
h: default 0 (last (ancestorChain dsu fuel index)) = nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0

nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0 = ancestor dsu fuel index
dsu: list Slot
fuel, index: nat
h: default 0 (Some (ancestor dsu fuel index)) = nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0

nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0 = ancestor dsu fuel index
dsu: list Slot
fuel, index: nat
h: ancestor dsu fuel index = nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0

nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0 = ancestor dsu fuel index
dsu: list Slot
fuel, index: nat
h: ancestor dsu fuel index = nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0

ancestor dsu fuel index = nth (length (ancestorChain dsu fuel index) - 1) (ancestorChain dsu fuel index) 0
exact h. Qed. Definition validChain (dsu : list Slot) (chain : list nat) := chain <> [] /\ nth 0 chain 0 < length dsu /\ forall index, S index < length chain -> nth (nth index chain 0) dsu (Ancestor Unit) = ReferTo (nth (S index) chain 0). Definition validChainToAncestor (dsu : list Slot) (chain : list nat) := validChain dsu chain /\ exists x, nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor x.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
hImage: _0 : nat, f _0 < 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
hImage: _0 : nat, f _0 < 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
f: nat → nat
hImage: _0 : nat, f _0 < 0
_0: f 0 < 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
lia.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
s: bool
hs: s = existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n)))

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
s: bool
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = s

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true
w: nat
h1: w < S n
h2: bool_decide (f w = f (S n)) = true

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true
w: nat
h1: w < S n
h2: f w = f (S n)

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true
w: nat
h1: w < S n
h2: f w = f (S n)

_0 : nat, w ≠ _0 ∧ w < S (S n) ∧ _0 < S (S n) ∧ f w = f _0
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = true
w: nat
h1: w < S n
h2: f w = f (S n)

w ≠ S n ∧ w < S (S n) ∧ S n < S (S n) ∧ f w = f (S n)
repeat split; try lia.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: notExistsInRangeLogic (S n) (λ _0 : nat, bool_decide (f _0 = f (S n)))

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))

_0 : nat, _0 < S n → f _0 ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))

_0 : nat, _0 < S n → f _0 ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n

f x ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ bool_decide (f x = f (S n))

f x ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ true
h1: f x = f (S n)

f x ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ false
h1: f x ≠ f (S n)
f x ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ true
h1: f x = f (S n)

f x ≠ f (S n)
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ true
h1: f x = f (S n)

False
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ true
h1: f x = f (S n)

true
easy.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
x: nat
h: x < S n
h2: ¬ false
h1: f x ≠ f (S n)

f x ≠ f (S n)
assumption.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n = 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n = 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n = 0
h2: f 0 < S n

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n = 0
h2: f 0 < S n
h3: f 1 < S n

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
step2: _0 : nat, _0 < 1 → f _0 ≠ f 1
step: _0 : nat, _0 < 1 → ¬ bool_decide (f _0 = f 1)
hs: existsInRange 1 (λ _0 : nat, bool_decide (f _0 = f 1)) = false
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < 0) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < 1 ∧ _2 < 1 ∧ _0 _1 = _0 _2
hImage: _0 : nat, f _0 < 1
h3: f 1 < 1
h2: f 0 < 1

_0 _1 : nat, _0 ≠ _1 ∧ _0 < 2 ∧ _1 < 2 ∧ f _0 = f _1
f: nat → nat
step2: _0 : nat, _0 < 1 → f _0 ≠ f 1
step: _0 : nat, _0 < 1 → ¬ bool_decide (f _0 = f 1)
hs: existsInRange 1 (λ _0 : nat, bool_decide (f _0 = f 1)) = false
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < 0) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < 1 ∧ _2 < 1 ∧ _0 _1 = _0 _2
hImage: _0 : nat, f _0 < 1
h3: f 1 < 1
h2: f 0 < 1

010 < 21 < 2 ∧ f 0 = f 1
split; lia.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: (if decide (f a < f (S n)) then f a else f a - 1) = (if decide (f b < f (S n)) then f b else f b - 1)

_0 _1 : nat, _0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: (if decide (f a < f (S n)) then f a else f a - 1) = (if decide (f b < f (S n)) then f b else f b - 1)

a ≠ b ∧ a < S (S n) ∧ b < S (S n) ∧ f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: (if decide (f a < f (S n)) then f a else f a - 1) = (if decide (f b < f (S n)) then f b else f b - 1)

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: f a < f (S n)
h3: ¬ f b < f (S n)
g: f a = f b - 1

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: f b < f (S n)
g: f a - 1 = f b
f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: ¬ f b < f (S n)
g: f a - 1 = f b - 1
f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: f a < f (S n)
h3: ¬ f b < f (S n)
g: f a = f b - 1

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: f a < f (S n)
h3: ¬ f b < f (S n)
g: f a = f b - 1
_0: f b ≠ f (S n)

f a = f b
lia.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: f b < f (S n)
g: f a - 1 = f b

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: f b < f (S n)
g: f a - 1 = f b
_0: f a ≠ f (S n)

f a = f b
lia.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: ¬ f b < f (S n)
g: f a - 1 = f b - 1

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: ¬ f b < f (S n)
g: f a - 1 = f b - 1
_0: f b ≠ f (S n)

f a = f b
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < S n
IH: _0 : nat → nat, ( _1 : nat, _0 _1 < n) → _1 _2 : nat, _1 ≠ _2 ∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
hs: existsInRange (S n) (λ _0 : nat, bool_decide (f _0 = f (S n))) = false
step: _0 : nat, _0 < S n → ¬ bool_decide (f _0 = f (S n))
step2: _0 : nat, _0 < S n → f _0 ≠ f (S n)
h1: n ≠ 0
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
h2: ¬ f a < f (S n)
h3: ¬ f b < f (S n)
g: f a - 1 = f b - 1
_0: f b ≠ f (S n)
_1: f a ≠ f (S n)

f a = f b
lia. Qed.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: a < b

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: b < a
_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: a < b

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: a < b

a < b ∧ a < S n ∧ b < S n ∧ f a = f b
repeat split; assumption.
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: b < a

_0 _1 : nat, _0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f a = f b
h: b < a

b < a ∧ b < S n ∧ a < S n ∧ f b = f a
f: nat → nat
n: nat
hImage: _0 : nat, f _0 < n
a, b: nat
c: a ≠ b
d: a < S n
e: b < S n
g: f b = f a
h: b < a

b < a ∧ b < S n ∧ a < S n ∧ f b = f a
repeat split; assumption. Qed.
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + delta < length chain
hJDelta: j + delta < length chain
hEq: nth i chain 0 = nth j chain 0

nth (i + delta) chain 0 = nth (j + delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + delta < length chain
hJDelta: j + delta < length chain
hEq: nth i chain 0 = nth j chain 0

nth (i + delta) chain 0 = nth (j + delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + 0 < length chain
hJDelta: j + 0 < length chain
hEq: nth i chain 0 = nth j chain 0

nth (i + 0) chain 0 = nth (j + 0) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + 0 < length chain
hJDelta: j + 0 < length chain
hEq: nth i chain 0 = nth j chain 0

nth (i + 0) chain 0 = nth (j + 0) chain 0
now rewrite !Nat.add_0_r.
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: nth (nth (i + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (i + delta)) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: nth (nth (i + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (i + delta)) chain 0)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (i + delta)) chain 0)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: ReferTo (nth (S (i + delta)) chain 0) = nth (nth (j + delta) chain 0) dsu (Ancestor Unit)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: ReferTo (nth (S (i + delta)) chain 0) = nth (nth (j + delta) chain 0) dsu (Ancestor Unit)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)
c3: ReferTo (nth (S (i + delta)) chain 0) = ReferTo (nth (S (j + delta)) chain 0)

nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: ReferTo (nth (S (i + delta)) chain 0) = nth (nth (j + delta) chain 0) dsu (Ancestor Unit)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)
c3: ReferTo (nth (S (i + delta)) chain 0) = ReferTo (nth (S (j + delta)) chain 0)

nth (S (i + delta)) chain 0 = nth (S (j + delta)) chain 0 → nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: ReferTo (nth (S (i + delta)) chain 0) = nth (nth (j + delta) chain 0) dsu (Ancestor Unit)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)
c3: ReferTo (nth (S (i + delta)) chain 0) = ReferTo (nth (S (j + delta)) chain 0)

nth (S (i + delta)) chain 0 = nth (S (j + delta)) chain 0 → nth (S (i + delta)) chain 0 = nth (S (j + delta)) chain 0
dsu: list Slot
chain: list nat
h2: validChain dsu chain
i, j, delta: nat
hI: i < length chain
hJ: j < length chain
hIDelta: i + S delta < length chain
hJDelta: j + S delta < length chain
hEq: nth i chain 0 = nth j chain 0
IH: i + delta < length chain → j + delta < length chain → nth (i + delta) chain 0 = nth (j + delta) chain 0
h: nth (i + delta) chain 0 = nth (j + delta) chain 0
a: chain ≠ []
b: nth 0 chain 0 < length dsu
c: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
c1: ReferTo (nth (S (i + delta)) chain 0) = nth (nth (j + delta) chain 0) dsu (Ancestor Unit)
c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (j + delta)) chain 0)
c3: ReferTo (nth (S (i + delta)) chain 0) = ReferTo (nth (S (j + delta)) chain 0)
h3: nth (S (i + delta)) chain 0 = nth (S (j + delta)) chain 0

nth (S (i + delta)) chain 0 = nth (S (j + delta)) chain 0
exact h3. Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: index < length chain

nth index chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: index < length chain

nth index chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h3: 0 < length chain

nth 0 chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: S index < length chain
IH: index < length chain → nth index chain 0 < length dsu
nth (S index) chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h3: 0 < length chain

nth 0 chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h3: 0 < length chain
x: nth 0 chain 0 < length dsu

nth 0 chain 0 < length dsu
exact x.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: S index < length chain
IH: index < length chain → nth index chain 0 < length dsu

nth (S index) chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: S index < length chain
IH: index < length chain → nth index chain 0 < length dsu

nth (nth index chain 0) dsu (Ancestor Unit) = ReferTo (nth (S index) chain 0)
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
index: nat
h3: S index < length chain
IH: index < length chain → nth index chain 0 < length dsu
x: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)

nth (nth index chain 0) dsu (Ancestor Unit) = ReferTo (nth (S index) chain 0)
exact (x index h3). Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain

nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain

nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain

_0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain

_0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
dsu: list Slot
chain: list nat
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain

noIllegalIndices dsu → validChainToAncestor dsu chain → _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
dsu: list Slot
chain: list nat

noIllegalIndices dsu → validChainToAncestor dsu chain → _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
i, j: nat
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
i, j: nat
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0
step: nth (i + (length chain - 1 - j)) chain 0 = nth (j + (length chain - 1 - j)) chain 0

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
i, j: nat
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0
step: nth (i + (length chain - 1 - j)) chain 0 = nth (j + (length chain - 1 - j)) chain 0
_0: 0 < length chain

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
i, j: nat
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0
step: nth (i + (length chain - 1 - j)) chain 0 = nth (length chain - 1) chain 0
_0: 0 < length chain

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
i, j: nat
c: nth (nth (i + (length chain - 1 - j)) chain 0) dsu (Ancestor Unit) = Ancestor b
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0
step: nth (i + (length chain - 1 - j)) chain 0 = nth (length chain - 1) chain 0
_0: 0 < length chain

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
i, j: nat
c: ReferTo (nth (S (i + (length chain - 1 - j))) chain 0) = Ancestor b
h3: i < j
h4: i < length chain
h5: j < length chain
h6: nth i chain 0 = nth j chain 0
step: nth (i + (length chain - 1 - j)) chain 0 = nth (length chain - 1) chain 0
_0: 0 < length chain

False
easy.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0

nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: i < j

nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: j < i
nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: i < j

nth i chain 0 ≠ nth j chain 0
apply wlog; assumption.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: j < i

nth i chain 0 ≠ nth j chain 0
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: j < i
g: nth i chain 0 = nth j chain 0

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: j < i
g: nth j chain 0 = nth i chain 0

False
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
i, j: nat
h4: i ≠ j
h5: i < length chain
h3: j < length chain
wlog: _0 _1 : nat, _0 < _1 → _0 < length chain → _1 < length chain → nth _0 chain 0 ≠ nth _1 chain 0
h: j < i

nth j chain 0 = nth i chain 0False
apply wlog; assumption. Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain

_0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain

_0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
apply chainElementsValidIndices; assumption.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: length dsu = 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: length dsu = 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: length dsu = 0

length chain ≤ length dsu
lia.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu

_0 : nat, nth _0 chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu

_0 : nat, nth _0 chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat

nth x chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat
hd: length chain ≤ x

nth x chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat
hd: x < length chain
nth x chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat
hd: length chain ≤ x

nth x chain 0 < length dsu
rewrite nth_overflow; lia.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat
hd: x < length chain

nth x chain 0 < length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
x: nat
hd: x < length chain

x < length chain
exact hd.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
g: a < length chain → b < length chain → a + (length chain - 1 - b) < length chain → b + (length chain - 1 - b) < length chain → nth a chain 0 = nth b chain 0 → nth (a + (length chain - 1 - b)) chain 0 = nth (b + (length chain - 1 - b)) chain 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
g: a < length chain → b < length chain → a + (length chain - 1 - b) < length chain → b + (length chain - 1 - b) < length chain → nth a chain 0 = nth b chain 0 → nth (a + (length chain - 1 - b)) chain 0 = nth (b + (length chain - 1 - b)) chain 0
hd: length dsu < length chain

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
g: a < length chain → b < length chain → a + (length chain - 1 - b) < length chain → b + (length chain - 1 - b) < length chain → nth a chain 0 = nth b chain 0 → nth (a + (length chain - 1 - b)) chain 0 = nth (b + (length chain - 1 - b)) chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (b + (length chain - 1 - b)) chain 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (b + (length chain - 1 - b)) chain 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
g1: nth (nth (a + (length chain - 1 - b)) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (a + (length chain - 1 - b))) chain 0)

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
g1: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (a + (length chain - 1 - b))) chain 0)

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
g1: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (a + (length chain - 1 - b))) chain 0)
x: Tree
g2: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor x

length chain ≤ length dsu
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
h: _0 : nat, _0 < length chain → nth _0 chain 0 < length dsu
hs: 0 < length dsu
h3: _0 : nat, nth _0 chain 0 < length dsu
a, b: nat
c: a < b
d: a < S (length dsu)
e: b < S (length dsu)
f: nth a chain 0 = nth b chain 0
hd: length dsu < length chain
i: nth (a + (length chain - 1 - b)) chain 0 = nth (length chain - 1) chain 0
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
g1: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (a + (length chain - 1 - b))) chain 0)
x: Tree
g2: ReferTo (nth (S (a + (length chain - 1 - b))) chain 0) = Ancestor x

length chain ≤ length dsu
easy. Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
h4: length chain ≤ fuel

chain = ancestorChain dsu fuel vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
h4: length chain ≤ fuel

chain = ancestorChain dsu fuel vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain

_0 : nat, nth 0 chain 0 = _0 → _1 : nat, length chain ≤ _1 → chain = ancestorChain dsu _1 _0
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex
fuel: nat
h4: length [] ≤ fuel

[] = ancestorChain dsu fuel vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ fuel
head :: tail = ancestorChain dsu fuel vertex
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex
fuel: nat
h4: length [] ≤ fuel

[] = ancestorChain dsu fuel vertex
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex
fuel: nat
h4: length [] ≤ fuel
e: [] ≠ []
f: nth 0 [] 0 < length dsu
g: _0 : nat, S _0 < length [] → nth (nth _0 [] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [] 0)
h: Tree
i: nth (nth (length [] - 1) [] 0) dsu (Ancestor Unit) = Ancestor h

[] = ancestorChain dsu fuel vertex
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex
fuel: nat
h4: length [] ≤ fuel
e: [] ≠ []
f: nth 0 [] 0 < length dsu
g: _0 : nat, S _0 < length [] → nth (nth _0 [] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [] 0)
h: Tree
i: nth (nth (length [] - 1) [] 0) dsu (Ancestor Unit) = Ancestor h

False
exact (e ltac:(reflexivity)).
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ fuel

head :: tail = ancestorChain dsu fuel vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = ancestorChain dsu fuel vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
h4: length (head :: tail) ≤ 0
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = ancestorChain dsu 0 vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
head :: tail = ancestorChain dsu (S fuel) vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
h4: length (head :: tail) ≤ 0
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = ancestorChain dsu 0 vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
h4: S (length tail) ≤ 0
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = ancestorChain dsu 0 vertex
lia.
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = ancestorChain dsu (S fuel) vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail = 0

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail = 0

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail = 0
_0: tail = []

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
h1: noIllegalIndices dsu
IH: validChainToAncestor dsu [] → _0 : nat, nth 0 [] 0 = _0 → _1 : nat, length [] ≤ _1 → [] = ancestorChain dsu _1 _0
h2: validChainToAncestor dsu [head]
vertex: nat
h3: nth 0 [head] 0 = vertex
fuel: nat
g: _0 : nat, S _0 < length [head] → nth (nth _0 [head] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [head] 0)
f: nth 0 [head] 0 < length dsu
e: [head] ≠ []
h4: length [head] ≤ S fuel
h: Tree
hs: length [] = 0
i: nth (nth (length [head] - 1) [head] 0) dsu (Ancestor Unit) = Ancestor h

[head] = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
h1: noIllegalIndices dsu
IH: validChainToAncestor dsu [] → _0 : nat, 0 = _0 → _1 : nat, 0 ≤ _1 → [] = ancestorChain dsu _1 _0
h2: validChainToAncestor dsu [head]
vertex: nat
h3: head = vertex
fuel: nat
g: _0 : nat, S _0 < 1 → nth match _0 with | 0 => head | _ => 0 end dsu (Ancestor Unit) = ReferTo match _0 with | 0 | _ => 0 end
f: head < length dsu
e: [head] ≠ []
h4: 1 ≤ S fuel
h: Tree
hs: 0 = 0
i: nth head dsu (Ancestor Unit) = Ancestor h

[head] = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
h1: noIllegalIndices dsu
IH: validChainToAncestor dsu [] → _0 : nat, 0 = _0 → _1 : nat, 0 ≤ _1 → [] = ancestorChain dsu _1 _0
vertex: nat
h2: validChainToAncestor dsu [vertex]
fuel: nat
e: [vertex] ≠ []
f: vertex < length dsu
g: _0 : nat, S _0 < 1 → nth match _0 with | 0 => vertex | _ => 0 end dsu (Ancestor Unit) = ReferTo match _0 with | 0 | _ => 0 end
h4: 1 ≤ S fuel
h: Tree
hs: 0 = 0
i: nth vertex dsu (Ancestor Unit) = Ancestor h

[vertex] = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
h1: noIllegalIndices dsu
IH: validChainToAncestor dsu [] → _0 : nat, 0 = _0 → _1 : nat, 0 ≤ _1 → [] = ancestorChain dsu _1 _0
vertex: nat
h2: validChainToAncestor dsu [vertex]
fuel: nat
e: [vertex] ≠ []
f: vertex < length dsu
g: _0 : nat, S _0 < 1 → nth match _0 with | 0 => vertex | _ => 0 end dsu (Ancestor Unit) = ReferTo match _0 with | 0 | _ => 0 end
h4: 1 ≤ S fuel
h: Tree
hs: 0 = 0
i: nth vertex dsu (Ancestor Unit) = Ancestor h

[vertex] = [vertex]
reflexivity.
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth (nth 0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth 1 (head :: tail) 0)

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth head dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
vertex: nat
h3: head = vertex
fuel: nat
h4: length (head :: tail) ≤ S fuel
e: head :: tail ≠ []
f: nth 0 (head :: tail) 0 < length dsu
g: _0 : nat, S _0 < length (head :: tail) → nth (nth _0 (head :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (head :: tail) 0)
h: Tree
i: nth (nth (length (head :: tail) - 1) (head :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth head dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)

head :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)

vertex :: tail = match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)

vertex :: tail = vertex :: ancestorChain dsu fuel (nth 0 tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

vertex :: tail = vertex :: ancestorChain dsu fuel (nth 0 tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

validChainToAncestor dsu tail
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
step3: validChainToAncestor dsu tail
vertex :: tail = vertex :: ancestorChain dsu fuel (nth 0 tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

validChainToAncestor dsu tail
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

tail ≠ []
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
nth 0 tail 0 < length dsu
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

tail ≠ []
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
step3: tail = []

False
dsu: list Slot
h1: noIllegalIndices dsu
vertex: nat
IH: validChainToAncestor dsu [] → _0 : nat, nth 0 [] 0 = _0 → _1 : nat, length [] ≤ _1 → [] = ancestorChain dsu _1 _0
h2: validChainToAncestor dsu [vertex]
fuel: nat
h4: length [vertex] ≤ S fuel
e: [vertex] ≠ []
f: nth 0 [vertex] 0 < length dsu
g: _0 : nat, S _0 < length [vertex] → nth (nth _0 [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [vertex] 0)
h: Tree
step2: validChainToAncestor dsu [] → [] = ancestorChain dsu fuel (nth 0 [] 0)
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 [] 0)
hs: length [] ≠ 0
i: nth (nth (length [vertex] - 1) [vertex] 0) dsu (Ancestor Unit) = Ancestor h

False
exact (hs ltac:(reflexivity)).
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

nth 0 tail 0 < length dsu
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

nth 0 tail 0 < length dsu
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
step3: nth 1 (vertex :: tail) 0 < length dsu

nth 0 tail 0 < length dsu
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
step3: nth 0 tail 0 < length dsu

nth 0 tail 0 < length dsu
exact step3.
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
a: nat
ha: S a < length tail

nth (nth a tail 0) dsu (Ancestor Unit) = ReferTo (nth (S a) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
a: nat
ha: S a < length tail
step3: nth (nth (S a) (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S (S a)) (vertex :: tail) 0)

nth (nth a tail 0) dsu (Ancestor Unit) = ReferTo (nth (S a) tail 0)
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
a: nat
ha: S a < length tail
step3: nth (nth a tail 0) dsu (Ancestor Unit) = ReferTo (nth (S a) tail 0)

nth (nth a tail 0) dsu (Ancestor Unit) = ReferTo (nth (S a) tail 0)
exact step3.
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor h
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (S (length tail - 1)) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor h
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor h
exact i. }
dsu: list Slot
tail: list nat
h1: noIllegalIndices dsu
vertex: nat
h2: validChainToAncestor dsu (vertex :: tail)
IH: validChainToAncestor dsu tail → _0 : nat, nth 0 tail 0 = _0 → _1 : nat, length tail ≤ _1 → tail = ancestorChain dsu _1 _0
fuel: nat
g: _0 : nat, S _0 < length (vertex :: tail) → nth (nth _0 (vertex :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (vertex :: tail) 0)
f: nth 0 (vertex :: tail) 0 < length dsu
e: vertex :: tail ≠ []
h4: length (vertex :: tail) ≤ S fuel
h: Tree
i: nth (nth (length (vertex :: tail) - 1) (vertex :: tail) 0) dsu (Ancestor Unit) = Ancestor h
hs: length tail ≠ 0
step: nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)
step2: validChainToAncestor dsu tail → tail = ancestorChain dsu fuel (nth 0 tail 0)
step3: validChainToAncestor dsu tail

vertex :: tail = vertex :: ancestorChain dsu fuel (nth 0 tail 0)
now rewrite <- (step2 step3). Qed.
dsu: list Slot
fuel, vertex: nat

nth 0 (ancestorChain dsu fuel vertex) 0 = vertex
dsu: list Slot
fuel, vertex: nat

nth 0 (ancestorChain dsu fuel vertex) 0 = vertex
dsu: list Slot
vertex: nat

nth 0 (ancestorChain dsu 0 vertex) 0 = vertex
dsu: list Slot
fuel, vertex: nat
nth 0 (ancestorChain dsu (S fuel) vertex) 0 = vertex
dsu: list Slot
vertex: nat

nth 0 (ancestorChain dsu 0 vertex) 0 = vertex
dsu: list Slot
vertex: nat

vertex = vertex
reflexivity.
dsu: list Slot
fuel, vertex: nat

nth 0 (ancestorChain dsu (S fuel) vertex) 0 = vertex
dsu: list Slot
fuel, vertex: nat

nth 0 match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0 = vertex
destruct (nth vertex dsu (Ancestor Unit)); easy. Qed.
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

validChain dsu (ancestorChain dsu fuel vertex)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

validChain dsu (ancestorChain dsu fuel vertex)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

validChain dsu (ancestorChain dsu 0 vertex)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
validChain dsu (ancestorChain dsu (S fuel) vertex)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

validChain dsu (ancestorChain dsu 0 vertex)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

validChain dsu [vertex]
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

[vertex] ≠ []
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
nth 0 [vertex] 0 < length dsu
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
_0 : nat, S _0 < length [vertex] → nth (nth _0 [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [vertex] 0)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

[vertex] ≠ []
easy.
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

nth 0 [vertex] 0 < length dsu
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
_0 : nat, S _0 < length [vertex] → nth (nth _0 [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [vertex] 0)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

nth 0 [vertex] 0 < length dsu
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

vertex < length dsu
lia.
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

_0 : nat, S _0 < length [vertex] → nth (nth _0 [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [vertex] 0)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu

_0 : nat, S _0 < length [vertex] → nth (nth _0 [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [vertex] 0)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
x: nat
h: S x < length [vertex]

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
dsu: list Slot
vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
x: nat
h: S x < 1

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
lia. }
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

validChain dsu (ancestorChain dsu (S fuel) vertex)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

ancestorChain dsu (S fuel) vertex ≠ []
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
nth 0 (ancestorChain dsu (S fuel) vertex) 0 < length dsu
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
_0 : nat, S _0 < length (ancestorChain dsu (S fuel) vertex) → nth (nth _0 (ancestorChain dsu (S fuel) vertex) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (S fuel) vertex) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

ancestorChain dsu (S fuel) vertex ≠ []
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end ≠ []
destruct (nth vertex dsu (Ancestor Unit)); easy.
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

nth 0 (ancestorChain dsu (S fuel) vertex) 0 < length dsu
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

vertex < length dsu
exact hVertex.
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)

_0 : nat, S _0 < length (ancestorChain dsu (S fuel) vertex) → nth (nth _0 (ancestorChain dsu (S fuel) vertex) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (S fuel) vertex) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)

nth (nth x (ancestorChain dsu (S fuel) vertex) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu (S fuel) vertex) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)

nth (nth x match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0) dsu (Ancestor Unit) = ReferTo (nth (S x) match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: Slot
he: e = nth vertex dsu (Ancestor Unit)

nth (nth x match e with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0) dsu (Ancestor Unit) = ReferTo (nth (S x) match e with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: Slot
he: nth vertex dsu (Ancestor Unit) = e

nth (nth x match e with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0) dsu (Ancestor Unit) = ReferTo (nth (S x) match e with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth (nth x (vertex :: ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (vertex :: ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: Tree
he: nth vertex dsu (Ancestor Unit) = Ancestor e
nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth (nth x (vertex :: ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (vertex :: ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth match x with | 0 => vertex | S _0 => nth _0 (ancestorChain dsu fuel e) 0 end dsu (Ancestor Unit) = ReferTo (nth x (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
h: 1 < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S (S x) < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e
nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
h: 1 < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth vertex dsu (Ancestor Unit) = ReferTo (nth 0 (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
h: 1 < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth vertex dsu (Ancestor Unit) = ReferTo e
exact he.
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S (S x) < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S (S x) < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e
hf: e < length dsu

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S (S x) < length (ancestorChain dsu (S fuel) vertex)
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e
hf: e < length dsu
g1: ancestorChain dsu fuel e ≠ []
g2: nth 0 (ancestorChain dsu fuel e) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu fuel e) → nth (nth _0 (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu fuel e) 0)

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S (S x) < length match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
e: nat
he: nth vertex dsu (Ancestor Unit) = ReferTo e
hf: e < length dsu
g1: ancestorChain dsu fuel e ≠ []
g2: nth 0 (ancestorChain dsu fuel e) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu fuel e) → nth (nth _0 (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu fuel e) 0)

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x, e: nat
h: S (S x) < length (vertex :: ancestorChain dsu fuel e)
he: nth vertex dsu (Ancestor Unit) = ReferTo e
hf: e < length dsu
g1: ancestorChain dsu fuel e ≠ []
g2: nth 0 (ancestorChain dsu fuel e) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu fuel e) → nth (nth _0 (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu fuel e) 0)

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x, e: nat
h: S (S x) < S (length (ancestorChain dsu fuel e))
he: nth vertex dsu (Ancestor Unit) = ReferTo e
hf: e < length dsu
g1: ancestorChain dsu fuel e ≠ []
g2: nth 0 (ancestorChain dsu fuel e) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu fuel e) → nth (nth _0 (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu fuel e) 0)

nth (nth x (ancestorChain dsu fuel e) 0) dsu (Ancestor Unit) = ReferTo (nth (S x) (ancestorChain dsu fuel e) 0)
exact (g3 x ltac:(lia)).
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length (ancestorChain dsu (S fuel) vertex)
e: Tree
he: nth vertex dsu (Ancestor Unit) = Ancestor e

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length match nth vertex dsu (Ancestor Unit) with | ReferTo _0 => vertex :: ancestorChain dsu fuel _0 | Ancestor _ => [vertex] end
e: Tree
he: nth vertex dsu (Ancestor Unit) = Ancestor e

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < length [vertex]
e: Tree
he: nth vertex dsu (Ancestor Unit) = Ancestor e

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
dsu: list Slot
fuel, vertex: nat
hVertex: vertex < length dsu
hDsu: noIllegalIndices dsu
IH: _0 : nat, _0 < length dsu → validChain dsu (ancestorChain dsu fuel _0)
x: nat
h: S x < 1
e: Tree
he: nth vertex dsu (Ancestor Unit) = Ancestor e

nth (nth x [vertex] 0) dsu (Ancestor Unit) = ReferTo (nth (S x) [vertex] 0)
lia. Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
vertex: nat
h3: nth 0 chain 0 = vertex

chain = ancestorChain dsu (length dsu) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
vertex: nat
h3: nth 0 chain 0 = vertex

chain = ancestorChain dsu (length dsu) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
vertex: nat
h3: nth 0 chain 0 = vertex

length chain ≤ length dsu
apply validChainMaxLength; assumption. Qed.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex

take (S fuel) chain = ancestorChain dsu fuel vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex

take (S fuel) chain = ancestorChain dsu fuel vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
vertex: nat
h3: nth 0 chain 0 = vertex

take 1 chain = ancestorChain dsu 0 vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
vertex: nat
h3: nth 0 chain 0 = vertex

take 1 chain = ancestorChain dsu 0 vertex
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex

take 1 [] = ancestorChain dsu 0 vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex
take 1 (head :: tail) = ancestorChain dsu 0 vertex
dsu: list Slot
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu []
vertex: nat
h3: nth 0 [] 0 = vertex

take 1 [] = ancestorChain dsu 0 vertex
dsu: list Slot
h1: noIllegalIndices dsu
e: [] ≠ []
f: nth 0 [] 0 < length dsu
g: _0 : nat, S _0 < length [] → nth (nth _0 [] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [] 0)
b: Tree
c: nth (nth (length [] - 1) [] 0) dsu (Ancestor Unit) = Ancestor b
vertex: nat
h3: nth 0 [] 0 = vertex

take 1 [] = ancestorChain dsu 0 vertex
dsu: list Slot
h1: noIllegalIndices dsu
e: [] ≠ []
f: nth 0 [] 0 < length dsu
g: _0 : nat, S _0 < length [] → nth (nth _0 [] 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) [] 0)
b: Tree
c: nth (nth (length [] - 1) [] 0) dsu (Ancestor Unit) = Ancestor b
vertex: nat
h3: nth 0 [] 0 = vertex

False
exact (e ltac:(reflexivity)).
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
vertex: nat
h3: nth 0 (head :: tail) 0 = vertex

take 1 (head :: tail) = ancestorChain dsu 0 vertex
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
vertex: nat
h3: head = vertex

head :: take 0 tail = [vertex]
dsu: list Slot
head: nat
tail: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu (head :: tail)
vertex: nat
h3: head = vertex

[vertex] = [vertex]
reflexivity.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex

take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]

take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)

take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: length chain ≤ S fuel
take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)

take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)

ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain

ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain

_0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain
h7: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain

_0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain

validChainToAncestor dsu chain → _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
dsu: list Slot
chain: list nat
fuel: nat

validChainToAncestor dsu chain → _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain

_0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
dsu: list Slot
chain: list nat
h2: validChainToAncestor dsu chain
delta: nat
h7: 1 + delta < length chain

ancestorChain dsu 0 (nth delta chain 0) ++ [nth (1 + delta) chain 0] = ancestorChain dsu 1 (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
ancestorChain dsu (S fuel) (nth delta chain 0) ++ [nth (S (S fuel) + delta) chain 0] = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
h2: validChainToAncestor dsu chain
delta: nat
h7: 1 + delta < length chain

ancestorChain dsu 0 (nth delta chain 0) ++ [nth (1 + delta) chain 0] = ancestorChain dsu 1 (nth delta chain 0)
dsu: list Slot
chain: list nat
h2: validChainToAncestor dsu chain
delta: nat
h7: 1 + delta < length chain

[nth delta chain 0; nth (S delta) chain 0] = match nth (nth delta chain 0) dsu (Ancestor Unit) with | ReferTo _0 => [nth delta chain 0; _0] | Ancestor _ => [nth delta chain 0] end
dsu: list Slot
chain: list nat
h2: validChainToAncestor dsu chain
delta: nat
h7: 1 + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

[nth delta chain 0; nth (S delta) chain 0] = match nth (nth delta chain 0) dsu (Ancestor Unit) with | ReferTo _0 => [nth delta chain 0; _0] | Ancestor _ => [nth delta chain 0] end
dsu: list Slot
chain: list nat
h2: validChainToAncestor dsu chain
delta: nat
h7: 1 + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

[nth delta chain 0; nth (S delta) chain 0] = [nth delta chain 0; nth (S delta) chain 0]
reflexivity.
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain

ancestorChain dsu (S fuel) (nth delta chain 0) ++ [nth (S (S fuel) + delta) chain 0] = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain

match nth (nth delta chain 0) dsu (Ancestor Unit) with | ReferTo _0 => nth delta chain 0 :: ancestorChain dsu fuel _0 | Ancestor _ => [nth delta chain 0] end ++ [nth (S (S fuel) + delta) chain 0] = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

match nth (nth delta chain 0) dsu (Ancestor Unit) with | ReferTo _0 => nth delta chain 0 :: ancestorChain dsu fuel _0 | Ancestor _ => [nth delta chain 0] end ++ [nth (S (S fuel) + delta) chain 0] = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

(nth delta chain 0 :: ancestorChain dsu fuel (nth (S delta) chain 0)) ++ [nth (S (S fuel) + delta) chain 0] = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

nth delta chain 0 :: ancestorChain dsu (S fuel) (nth (S delta) chain 0) = ancestorChain dsu (S (S fuel)) (nth delta chain 0)
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

nth delta chain 0 :: ancestorChain dsu (S fuel) (nth (S delta) chain 0) = match nth (nth delta chain 0) dsu (Ancestor Unit) with | ReferTo _0 => nth delta chain 0 :: ancestorChain dsu (S fuel) _0 | Ancestor _ => [nth delta chain 0] end
dsu: list Slot
chain: list nat
fuel: nat
h2: validChainToAncestor dsu chain
IH: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
delta: nat
h7: S (S fuel) + delta < length chain
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b

nth delta chain 0 :: ancestorChain dsu (S fuel) (nth (S delta) chain 0) = nth delta chain 0 :: ancestorChain dsu (S fuel) (nth (S delta) chain 0)
reflexivity.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain
h7: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)

ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain
h7: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
_0: ancestorChain dsu fuel (nth 0 chain 0) ++ [nth (S fuel + 0) chain 0] = ancestorChain dsu (S fuel) (nth 0 chain 0)

ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain
h7: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
_0: ancestorChain dsu fuel (nth 0 chain 0) ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) (nth 0 chain 0)

ancestorChain dsu fuel vertex ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel: nat
IH: take (S fuel) chain = ancestorChain dsu fuel (nth 0 chain 0)
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: chain !! S fuel = Some (nth (S fuel) chain 0)
h6: S fuel < length chain
h7: _0 : nat, S fuel + _0 < length chain → ancestorChain dsu fuel (nth _0 chain 0) ++ [nth (S fuel + _0) chain 0] = ancestorChain dsu (S fuel) (nth _0 chain 0)
_0: ancestorChain dsu fuel (nth 0 chain 0) ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) (nth 0 chain 0)

ancestorChain dsu fuel (nth 0 chain 0) ++ [nth (S fuel) chain 0] = ancestorChain dsu (S fuel) (nth 0 chain 0)
assumption.
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: length chain ≤ S fuel

take (S (S fuel)) chain = ancestorChain dsu (S fuel) vertex
dsu: list Slot
chain: list nat
h1: noIllegalIndices dsu
h2: validChainToAncestor dsu chain
fuel, vertex: nat
h3: nth 0 chain 0 = vertex
IH: take (S fuel) chain = ancestorChain dsu fuel vertex
h4: chain !! S fuel = Some (nth (S fuel) chain 0) → take (S (S fuel)) chain = take (S fuel) chain ++ [nth (S fuel) chain 0]
h5: length chain ≤ S fuel

chain = ancestorChain dsu (S fuel) vertex
exact (validChainLe dsu chain h1 h2 (S fuel) vertex h3 h5). Qed.
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu

ancestor dsu n index < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu

ancestor dsu n index < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu

ancestor dsu (S n) index < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu

match nth index dsu (Ancestor Unit) with | ReferTo _0 => ancestor dsu n _0 | Ancestor _ => index end < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: Slot
hX: x = nth index dsu (Ancestor Unit)

match x with | ReferTo _0 => ancestor dsu n _0 | Ancestor _ => index end < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: Slot
hX: nth index dsu (Ancestor Unit) = x

match x with | ReferTo _0 => ancestor dsu n _0 | Ancestor _ => index end < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x

ancestor dsu n x < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: Tree
hX: nth index dsu (Ancestor Unit) = Ancestor x
index < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x

ancestor dsu n x < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x
_0: x < length dsu

ancestor dsu n x < length dsu
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: nat
hX: nth index dsu (Ancestor Unit) = ReferTo x
_0: x < length dsu

x < length dsu
lia.
dsu: list Slot
h: noIllegalIndices dsu
n, index: nat
h1: index < length dsu
IH: _0 : nat, _0 < length dsu → ancestor dsu n _0 < length dsu
x: Tree
hX: nth index dsu (Ancestor Unit) = Ancestor x

index < length dsu
exact h1. Qed. Definition withoutCyclesN (dsu : list Slot) (n : nat) := forall x, x < n -> match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | Ancestor _ => true | _ => false end.
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v

ancestor dsu (length dsu) u = ancestor dsu (length dsu) v
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v

ancestor dsu (length dsu) u = ancestor dsu (length dsu) v
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v

nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu

nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu

0 < length dsu
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu

0 < length dsu
u, v: nat
hU: u < length []
h: noIllegalIndices []
h': withoutCyclesN [] (length [])
hR: nth u [] (Ancestor Unit) = ReferTo v
hV: v < length []

0 < length []
head: Slot
tail: list Slot
u, v: nat
hU: u < length (head :: tail)
h: noIllegalIndices (head :: tail)
h': withoutCyclesN (head :: tail) (length (head :: tail))
hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v
hV: v < length (head :: tail)
0 < length (head :: tail)
u, v: nat
hU: u < length []
h: noIllegalIndices []
h': withoutCyclesN [] (length [])
hR: nth u [] (Ancestor Unit) = ReferTo v
hV: v < length []

0 < length []
u, v: nat
hU: u < length []
h: noIllegalIndices []
h': withoutCyclesN [] (length [])
hR: match u with | 0 | _ => Ancestor Unit end = ReferTo v
hV: v < length []

0 < length []
easy.
head: Slot
tail: list Slot
u, v: nat
hU: u < length (head :: tail)
h: noIllegalIndices (head :: tail)
h': withoutCyclesN (head :: tail) (length (head :: tail))
hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v
hV: v < length (head :: tail)

0 < length (head :: tail)
head: Slot
tail: list Slot
u, v: nat
hU: u < length (head :: tail)
h: noIllegalIndices (head :: tail)
h': withoutCyclesN (head :: tail) (length (head :: tail))
hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v
hV: v < length (head :: tail)

0 < S (length tail)
lia.
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (ancestorChain dsu (S (length dsu - 1)) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu (length dsu - 1) _0 | Ancestor _ => [u] end - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (u :: ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (u :: ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (S (length dsu - 1)) u) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (ancestorChain dsu (length dsu - 1) v) - 0) match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu (length dsu - 1) _0 | Ancestor _ => [u] end 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length (ancestorChain dsu (S (length dsu - 1)) u) - 1) (ancestorChain dsu (S (length dsu - 1)) u) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu (length dsu - 1) _0 | Ancestor _ => [u] end - 1) match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu (length dsu - 1) _0 | Ancestor _ => [u] end 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length (u :: ancestorChain dsu (length dsu - 1) v) - 1) (u :: ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth match length (ancestorChain dsu (length dsu - 1) v) - 0 with | 0 => u | S _0 => nth _0 (ancestorChain dsu (length dsu - 1) v) 0 end dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth match length (ancestorChain dsu (length dsu - 1) v) with | 0 => u | S _0 => nth _0 (ancestorChain dsu (length dsu - 1) v) 0 end dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth match length (ancestorChain dsu (length dsu - 1) v) with | 0 => u | S _0 => nth _0 (ancestorChain dsu (length dsu - 1) v) 0 end dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (S (length (ancestorChain dsu (length dsu - 1) v) - 1)) (u :: ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
hB: match nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Slot
he: e = nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit)
hB: match e with | ReferTo _ => false | Ancestor _ => true end
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: nat
he: ReferTo e = nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit)
hB: false
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: Ancestor e = nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit)
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)
nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: nat
he: ReferTo e = nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit)
hB: false
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
easy.
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: Ancestor e = nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit)
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)
validChainToAncestor dsu (ancestorChain dsu (length dsu - 1) v)
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0 = nth (length (ancestorChain dsu (length dsu) v) - 1) (ancestorChain dsu (length dsu) v) 0
reflexivity.
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

validChainToAncestor dsu (ancestorChain dsu (length dsu - 1) v)
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

validChain dsu (ancestorChain dsu (length dsu - 1) v)
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

validChain dsu (ancestorChain dsu (length dsu - 1) v)
apply validChainAncestorChain; assumption.
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, v: nat
hU: u < length dsu
h: noIllegalIndices dsu
h': withoutCyclesN dsu (length dsu)
hR: nth u dsu (Ancestor Unit) = ReferTo v
hV: v < length dsu
hL: 0 < length dsu
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
hB: true
hA: 0 < length (ancestorChain dsu (length dsu - 1) v)

nth (nth (length (ancestorChain dsu (length dsu - 1) v) - 1) (ancestorChain dsu (length dsu - 1) v) 0) dsu (Ancestor Unit) = Ancestor e
exact he. Qed. Fixpoint withoutCyclesBool (dsu : list Slot) (n : nat) : bool := match n with | O => true | S n => match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | Ancestor _ => withoutCyclesBool dsu n | _ => false end end.
dsu: list Slot
n: nat

withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
dsu: list Slot
n: nat

withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
dsu: list Slot

withoutCyclesN dsu 0 ↔ withoutCyclesBool dsu 0
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
withoutCyclesN dsu (S n) ↔ withoutCyclesBool dsu (S n)
dsu: list Slot

withoutCyclesN dsu 0 ↔ withoutCyclesBool dsu 0
dsu: list Slot

withoutCyclesN dsu 0True
dsu: list Slot

( _0 : nat, _0 < 0match nth (ancestor dsu (length dsu) _0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end) ↔ True
split; intros; lia.
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n

withoutCyclesN dsu (S n) ↔ withoutCyclesBool dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)

withoutCyclesBool dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesBool dsu (S n)
withoutCyclesN dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)

withoutCyclesBool dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)

match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)
step: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)
_0: Tree
step: true

withoutCyclesBool dsu n
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)
_0: Tree
step: true

withoutCyclesN dsu n
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)
_0: Tree
step: true
x: nat
y: x < n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesN dsu (S n)
_0: Tree
step: true
x: nat
y: x < n
_1: match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
assumption.
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesBool dsu (S n)

withoutCyclesN dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: withoutCyclesBool dsu (S n)

withoutCyclesN dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end

withoutCyclesN dsu (S n)
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n
h2: x = n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n
h2: x < n
match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n
h2: x = n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n
h2: x = n

match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h3: Tree
h: withoutCyclesBool dsu n
x: nat
y: x < S n
h2: x = n

true
easy.
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
h: match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => withoutCyclesBool dsu n end
x: nat
y: x < S n
h2: x < n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
_0: Tree
h: withoutCyclesBool dsu n
x: nat
y: x < S n
h2: x < n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
_0: Tree
h: withoutCyclesN dsu n
x: nat
y: x < S n
h2: x < n

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
n: nat
IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
_0: Tree
h: withoutCyclesN dsu n
x: nat
y: x < S n
h2: x < n
_1: match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) x) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
assumption. } Qed.
dsu: list Slot
fuel, u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestorChain dsu fuel u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel u
dsu: list Slot
fuel, u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestorChain dsu fuel u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel u
dsu: list Slot
fuel, u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end

u < length dsu → ( _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x) → ancestorChain dsu fuel u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end

_0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
dsu: list Slot
x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestorChain dsu 0 u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) 0 u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
ancestorChain dsu (S fuel) u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (S fuel) u
dsu: list Slot
x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestorChain dsu 0 u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) 0 u
easy.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestorChain dsu (S fuel) u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (S fuel) u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (length dsu) u) 0 ≠ x

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (length dsu) u) 0 ≠ x

nth 0 (ancestorChain dsu (length dsu) u) 0 = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step2: nth 0 (ancestorChain dsu (length dsu) u) 0 = u
match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (length dsu) u) 0 ≠ x

nth 0 (ancestorChain dsu (length dsu) u) 0 = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
hd: _1 : nat, _1 < length (ancestorChain dsu (S _0) u) → nth _1 (ancestorChain dsu (S _0) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (S _0) u) 0 ≠ x

nth 0 (ancestorChain dsu (S _0) u) 0 = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
hd: _1 : nat, _1 < length (ancestorChain dsu (S _0) u) → nth _1 (ancestorChain dsu (S _0) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (S _0) u) 0 ≠ x

nth 0 match nth u dsu (Ancestor Unit) with | ReferTo _1 => u :: ancestorChain dsu _0 _1 | Ancestor _ => [u] end 0 = u
destruct (nth u dsu (Ancestor Unit)); easy.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: nth 0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step2: nth 0 (ancestorChain dsu (length dsu) u) 0 = u

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: nth 0 (ancestorChain dsu (length dsu) u) 0 = u

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
step3: default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u) = default (Ancestor Unit) (dsu !! u)

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = nth u dsu (Ancestor Unit)

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = nth u dsu (Ancestor Unit)

match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: Slot
hs: s = nth u dsu (Ancestor Unit)
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = s

match s with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match s with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: Slot
hs: nth u dsu (Ancestor Unit) = s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = s

match s with | ReferTo _0 => u :: ancestorChain dsu fuel _0 | Ancestor _ => [u] end = match s with | ReferTo _0 => u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0 | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

u :: ancestorChain dsu fuel s = u :: ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel s
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

u :: ancestorChain dsu fuel s = u :: ancestorChain dsu fuel s
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
s < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
_0 : nat, _0 < length (ancestorChain dsu (length dsu) s) → nth _0 (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

u :: ancestorChain dsu fuel s = u :: ancestorChain dsu fuel s
reflexivity.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

s < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
_0 : nat, _0 < length (ancestorChain dsu (length dsu) s) → nth _0 (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

s < length dsu
exact (h1 u s hs).
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s

_0 : nat, _0 < length (ancestorChain dsu (length dsu) s) → nth _0 (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (ancestorChain dsu (length dsu) u) → nth (S y) (ancestorChain dsu (length dsu) u) 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
toChop: list nat
hC: toChop = ancestorChain dsu (length dsu) u
hd: _0 : nat, _0 < length toChop → nth _0 toChop 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length toChop → nth (S y) toChop 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
toChop: list nat
hC: ancestorChain dsu (length dsu) u = toChop
hd: _0 : nat, _0 < length toChop → nth _0 toChop 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length toChop → nth (S y) toChop 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hC: ancestorChain dsu (length dsu) u = []
hd: _0 : nat, _0 < length [] → nth _0 [] 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length [] → nth (S y) [] 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
hC: ancestorChain dsu (length dsu) u = []
hd: _0 : nat, _0 < length [] → nth _0 [] 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length [] → nth (S y) [] 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
hC: match nth u dsu (Ancestor Unit) with | ReferTo _1 => u :: ancestorChain dsu _0 _1 | Ancestor _ => [u] end = []
hd: _0 : nat, _0 < length [] → nth _0 [] 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (S _0) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (S _0) s)
step4: S y < length [] → nth (S y) [] 0 ≠ x

nth y (ancestorChain dsu (S _0) s) 0 ≠ x
destruct (nth u dsu (Ancestor Unit)); simpl in hC; easy.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x

head = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x
hz: head = u
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x

head = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
head: nat
tail: list nat
hC: match nth u dsu (Ancestor Unit) with | ReferTo _1 => u :: ancestorChain dsu _0 _1 | Ancestor _ => [u] end = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (S _0) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (S _0) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x

head = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
head: nat
tail: list nat
_1: nat
hC: u :: ancestorChain dsu _0 _1 = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (S _0) x)]> dsu !! u = dsu !! u
s: nat
hs: ReferTo _1 = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (S _0) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x

head = u
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
_0: nat
h2: withoutCyclesN dsu (S _0)
h4: x < S _0
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _1 : nat, _1 < S _0 → ( _2 : nat, _2 < length (ancestorChain dsu (S _0) _1) → nth _2 (ancestorChain dsu (S _0) _1) 0 ≠ x) → ancestorChain dsu fuel _1 = ancestorChain (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) fuel _1
u: nat
h3: u < S _0
head: nat
tail: list nat
_1: nat
hC: u :: ancestorChain dsu _0 _1 = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (S _0) x)]> dsu !! u = dsu !! u
s: nat
hs: ReferTo _1 = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (S _0) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (S _0) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x
_3: u = head
_4: ancestorChain dsu _0 _1 = tail

head = head
reflexivity.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
head: nat
tail: list nat
hC: ancestorChain dsu (length dsu) u = head :: tail
hd: _0 : nat, _0 < length (head :: tail) → nth _0 (head :: tail) 0 ≠ x
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (head :: tail) → nth (S y) (head :: tail) 0 ≠ x
hz: head = u

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < length (u :: tail) → nth (S y) (u :: tail) 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu = 0

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0
1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu = 0

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu = 0
_0: dsu = []

1 < length dsu
fuel, x: nat
IH: _0 : nat, _0 < length [] → ( _1 : nat, _1 < length (ancestorChain [] (length []) _0) → nth _1 (ancestorChain [] (length []) _0) 0 ≠ x) → ancestorChain [] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [] (length []) x)]> []) fuel _0
h5: match nth x [] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length []
h2: withoutCyclesN [] (length [])
h1: noIllegalIndices []
u: nat
h3: u < length []
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [] (length []) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [] (length []) x)]> [] !! u = [] !! u
s: nat
step3: nth u (<[x:=ReferTo (ancestor [] (length []) x)]> []) (Ancestor Unit) = ReferTo s
hs: nth u [] (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [] (length []) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g: length [] = 0
c: _0 : nat, S _0 < length (ancestorChain [] (length []) u) → nth (nth _0 (ancestorChain [] (length []) u) 0) [] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [] (length []) u) 0)
b: nth 0 (ancestorChain [] (length []) u) 0 < length []
a: ancestorChain [] (length []) u ≠ []

1 < length []
fuel, x: nat
IH: _0 : nat, _0 < 0 → ( _1 : nat, _1 < 1match _1 with | 0 => _0 | _ => 0 end ≠ x) → ancestorChain [] fuel _0 = ancestorChain (<[x:=ReferTo x]> []) fuel _0
h5: match match x with | 0 | _ => Ancestor Unit end with | ReferTo _ => true | Ancestor _ => false end
h4: x < 0
h2: withoutCyclesN [] 0
h1: noIllegalIndices []
u: nat
h3: u < 0
tail: list nat
hd: _0 : nat, _0 < S (length tail) → match _0 with | 0 => u | S _1 => nth _1 tail 0 end ≠ x
hC: [u] = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo x]> [] !! u = [] !! u
s: nat
step3, hs: match u with | 0 | _ => Ancestor Unit end = ReferTo s
y: nat
hy: y < 1
step4: S y < S (length tail) → nth y tail 0 ≠ x
g: 0 = 0
c: _0 : nat, S _0 < 1match match _0 with | 0 => u | _ => 0 end with | 0 | _ => Ancestor Unit end = ReferTo match _0 with | 0 | _ => 0 end
b: u < 0
a: [u] ≠ []

1 < 0
easy.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0
g1: length dsu = 1

1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0
g1: length dsu ≠ 1
1 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0
g1: length dsu = 1

1 < length dsu
fuel, x: nat
h1: noIllegalIndices []
h2: withoutCyclesN [] (length [])
h4: x < length []
h5: match nth x [] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [] → ( _1 : nat, _1 < length (ancestorChain [] (length []) _0) → nth _1 (ancestorChain [] (length []) _0) 0 ≠ x) → ancestorChain [] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [] (length []) x)]> []) fuel _0
u: nat
h3: u < length []
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [] (length []) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [] (length []) x)]> [] !! u = [] !! u
s: nat
hs: nth u [] (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor [] (length []) x)]> []) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [] (length []) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain [] (length []) u ≠ []
b: nth 0 (ancestorChain [] (length []) u) 0 < length []
c: _0 : nat, S _0 < length (ancestorChain [] (length []) u) → nth (nth _0 (ancestorChain [] (length []) u) 0) [] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [] (length []) u) 0)
g: length [] ≠ 0
g1: length [] = 1

1 < length []
head: Slot
taill: list Slot
fuel, x: nat
h1: noIllegalIndices (head :: taill)
h2: withoutCyclesN (head :: taill) (length (head :: taill))
h4: x < length (head :: taill)
h5: match nth x (head :: taill) (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length (head :: taill) → ( _1 : nat, _1 < length (ancestorChain (head :: taill) (length (head :: taill)) _0) → nth _1 (ancestorChain (head :: taill) (length (head :: taill)) _0) 0 ≠ x) → ancestorChain (head :: taill) fuel _0 = ancestorChain (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) fuel _0
u: nat
h3: u < length (head :: taill)
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain (head :: taill) (length (head :: taill)) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill) !! u = (head :: taill) !! u
s: nat
hs: nth u (head :: taill) (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain (head :: taill) (length (head :: taill)) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain (head :: taill) (length (head :: taill)) u ≠ []
b: nth 0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0 < length (head :: taill)
c: _0 : nat, S _0 < length (ancestorChain (head :: taill) (length (head :: taill)) u) → nth (nth _0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0) (head :: taill) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain (head :: taill) (length (head :: taill)) u) 0)
g: length (head :: taill) ≠ 0
g1: length (head :: taill) = 1
1 < length (head :: taill)
fuel, x: nat
h1: noIllegalIndices []
h2: withoutCyclesN [] (length [])
h4: x < length []
h5: match nth x [] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [] → ( _1 : nat, _1 < length (ancestorChain [] (length []) _0) → nth _1 (ancestorChain [] (length []) _0) 0 ≠ x) → ancestorChain [] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [] (length []) x)]> []) fuel _0
u: nat
h3: u < length []
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [] (length []) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [] (length []) x)]> [] !! u = [] !! u
s: nat
hs: nth u [] (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor [] (length []) x)]> []) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [] (length []) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain [] (length []) u ≠ []
b: nth 0 (ancestorChain [] (length []) u) 0 < length []
c: _0 : nat, S _0 < length (ancestorChain [] (length []) u) → nth (nth _0 (ancestorChain [] (length []) u) 0) [] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [] (length []) u) 0)
g: length [] ≠ 0
g1: length [] = 1

1 < length []
fuel, x: nat
h1: noIllegalIndices []
h2: withoutCyclesN [] (length [])
h4: x < length []
h5: match nth x [] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [] → ( _1 : nat, _1 < length (ancestorChain [] (length []) _0) → nth _1 (ancestorChain [] (length []) _0) 0 ≠ x) → ancestorChain [] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [] (length []) x)]> []) fuel _0
u: nat
h3: u < length []
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [] (length []) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [] (length []) x)]> [] !! u = [] !! u
s: nat
hs: nth u [] (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor [] (length []) x)]> []) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [] (length []) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain [] (length []) u ≠ []
b: nth 0 (ancestorChain [] (length []) u) 0 < length []
c: _0 : nat, S _0 < length (ancestorChain [] (length []) u) → nth (nth _0 (ancestorChain [] (length []) u) 0) [] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [] (length []) u) 0)
g: length [] ≠ 0
g1: 0 = 1

1 < length []
easy.
head: Slot
taill: list Slot
fuel, x: nat
h1: noIllegalIndices (head :: taill)
h2: withoutCyclesN (head :: taill) (length (head :: taill))
h4: x < length (head :: taill)
h5: match nth x (head :: taill) (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length (head :: taill) → ( _1 : nat, _1 < length (ancestorChain (head :: taill) (length (head :: taill)) _0) → nth _1 (ancestorChain (head :: taill) (length (head :: taill)) _0) 0 ≠ x) → ancestorChain (head :: taill) fuel _0 = ancestorChain (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) fuel _0
u: nat
h3: u < length (head :: taill)
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain (head :: taill) (length (head :: taill)) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill) !! u = (head :: taill) !! u
s: nat
hs: nth u (head :: taill) (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain (head :: taill) (length (head :: taill)) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain (head :: taill) (length (head :: taill)) u ≠ []
b: nth 0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0 < length (head :: taill)
c: _0 : nat, S _0 < length (ancestorChain (head :: taill) (length (head :: taill)) u) → nth (nth _0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0) (head :: taill) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain (head :: taill) (length (head :: taill)) u) 0)
g: length (head :: taill) ≠ 0
g1: length (head :: taill) = 1

1 < length (head :: taill)
head: Slot
taill: list Slot
fuel, x: nat
h1: noIllegalIndices (head :: taill)
h2: withoutCyclesN (head :: taill) (length (head :: taill))
h4: x < length (head :: taill)
h5: match nth x (head :: taill) (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length (head :: taill) → ( _1 : nat, _1 < length (ancestorChain (head :: taill) (length (head :: taill)) _0) → nth _1 (ancestorChain (head :: taill) (length (head :: taill)) _0) 0 ≠ x) → ancestorChain (head :: taill) fuel _0 = ancestorChain (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) fuel _0
u: nat
h3: u < length (head :: taill)
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain (head :: taill) (length (head :: taill)) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill) !! u = (head :: taill) !! u
s: nat
hs: nth u (head :: taill) (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain (head :: taill) (length (head :: taill)) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain (head :: taill) (length (head :: taill)) u ≠ []
b: nth 0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0 < length (head :: taill)
c: _0 : nat, S _0 < length (ancestorChain (head :: taill) (length (head :: taill)) u) → nth (nth _0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0) (head :: taill) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain (head :: taill) (length (head :: taill)) u) 0)
g: length (head :: taill) ≠ 0
g1: S (length taill) = 1

1 < length (head :: taill)
head: Slot
taill: list Slot
fuel, x: nat
h1: noIllegalIndices (head :: taill)
h2: withoutCyclesN (head :: taill) (length (head :: taill))
h4: x < length (head :: taill)
h5: match nth x (head :: taill) (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length (head :: taill) → ( _1 : nat, _1 < length (ancestorChain (head :: taill) (length (head :: taill)) _0) → nth _1 (ancestorChain (head :: taill) (length (head :: taill)) _0) 0 ≠ x) → ancestorChain (head :: taill) fuel _0 = ancestorChain (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) fuel _0
u: nat
h3: u < length (head :: taill)
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain (head :: taill) (length (head :: taill)) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill) !! u = (head :: taill) !! u
s: nat
hs: nth u (head :: taill) (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor (head :: taill) (length (head :: taill)) x)]> (head :: taill)) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain (head :: taill) (length (head :: taill)) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain (head :: taill) (length (head :: taill)) u ≠ []
b: nth 0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0 < length (head :: taill)
c: _0 : nat, S _0 < length (ancestorChain (head :: taill) (length (head :: taill)) u) → nth (nth _0 (ancestorChain (head :: taill) (length (head :: taill)) u) 0) (head :: taill) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain (head :: taill) (length (head :: taill)) u) 0)
g: length (head :: taill) ≠ 0
g1: S (length taill) = 1
_0: taill = []

1 < length (head :: taill)
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
u: nat
h3: u < length [head]
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [head] (length [head]) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! u = [head] !! u
s: nat
step3: nth u (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
hs: nth u [head] (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) u) → nth (nth _0 (ancestorChain [head] (length [head]) u) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) u) 0)
b: nth 0 (ancestorChain [head] (length [head]) u) 0 < length [head]
a: ancestorChain [head] (length [head]) u ≠ []

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
u: nat
h3: u < length [head]
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain [head] (length [head]) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! u = [head] !! u
s: nat
step3: nth u (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
hs: nth u [head] (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) u) → nth (nth _0 (ancestorChain [head] (length [head]) u) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) u) 0)
b: nth 0 (ancestorChain [head] (length [head]) u) 0 < length [head]
a: ancestorChain [head] (length [head]) u ≠ []
_0: u = 0

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
s: nat
hs: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
s: nat
hs: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: s < length [head]

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
s: nat
hs: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: s < 1

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
s: nat
hs: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain [head] (length [head]) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: s < 1
_0: s = 0

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo 0
hs: nth 0 [head] (Ancestor Unit) = ReferTo 0
y: nat
hy: y < length (ancestorChain [head] (length [head]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: 0 < 1

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo 0
hs: nth 0 [head] (Ancestor Unit) = ReferTo 0
y: nat
hy: y < length (ancestorChain [head] (length [head]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: 0 < 1
g3: match nth (ancestor [head] (length [head]) 0) [head] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

1 < length [head]
head: Slot
fuel, x: nat
IH: _0 : nat, _0 < length [head] → ( _1 : nat, _1 < length (ancestorChain [head] (length [head]) _0) → nth _1 (ancestorChain [head] (length [head]) _0) 0 ≠ x) → ancestorChain [head] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) fuel _0
h5: match nth x [head] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h4: x < length [head]
h2: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
h3: 0 < length [head]
tail: list nat
step2: <[x:=ReferTo (ancestor [head] (length [head]) x)]> [head] !! 0 = [head] !! 0
step1: 0 ≠ x
hC: ancestorChain [head] (length [head]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [head] (length [head]) x)]> [head]) (Ancestor Unit) = ReferTo 0
hs: head = ReferTo 0
y: nat
hy: y < length (ancestorChain [head] (length [head]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
g: length [head] ≠ 0
a: ancestorChain [head] (length [head]) 0 ≠ []
b: nth 0 (ancestorChain [head] (length [head]) 0) 0 < length [head]
c: _0 : nat, S _0 < length (ancestorChain [head] (length [head]) 0) → nth (nth _0 (ancestorChain [head] (length [head]) 0) 0) [head] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [head] (length [head]) 0) 0)
g2: 0 < 1
g3: match nth (ancestor [head] (length [head]) 0) [head] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

1 < length [head]
fuel, x: nat
h3: 0 < length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h2: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
h4: x < length [ReferTo 0]
h5: match nth x [ReferTo 0] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [ReferTo 0] → ( _1 : nat, _1 < length (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) → nth _1 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) 0 ≠ x) → ancestorChain [ReferTo 0] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) fuel _0
tail: list nat
step2: <[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0] !! 0 = [ReferTo 0] !! 0
step1: 0 ≠ x
hC: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) (Ancestor Unit) = ReferTo 0
y: nat
hy: y < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
c: _0 : nat, S _0 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → nth (nth _0 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0) [ReferTo 0] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0)
b: nth 0 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 < length [ReferTo 0]
a: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 ≠ []
g: length [ReferTo 0] ≠ 0
g2: 0 < 1
g3: match nth (ancestor [ReferTo 0] (length [ReferTo 0]) 0) [ReferTo 0] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

1 < length [ReferTo 0]
fuel, x: nat
h3: 0 < length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h2: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
h4: x < length [ReferTo 0]
h5: match nth x [ReferTo 0] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [ReferTo 0] → ( _1 : nat, _1 < length (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) → nth _1 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) 0 ≠ x) → ancestorChain [ReferTo 0] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) fuel _0
tail: list nat
step2: <[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0] !! 0 = [ReferTo 0] !! 0
step1: 0 ≠ x
hC: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) (Ancestor Unit) = ReferTo 0
y: nat
hy: y < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
c: _0 : nat, S _0 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → nth (nth _0 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0) [ReferTo 0] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0)
b: nth 0 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 < length [ReferTo 0]
a: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 ≠ []
g: length [ReferTo 0] ≠ 0
g2: 0 < 1
g3: False

1 < length [ReferTo 0]
fuel, x: nat
h3: 0 < length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h2: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
h4: x < length [ReferTo 0]
h5: match nth x [ReferTo 0] (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length [ReferTo 0] → ( _1 : nat, _1 < length (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) → nth _1 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) _0) 0 ≠ x) → ancestorChain [ReferTo 0] fuel _0 = ancestorChain (<[x:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) fuel _0
tail: list nat
step2: <[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0] !! 0 = [ReferTo 0] !! 0
step1: 0 ≠ x
hC: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 = 0 :: tail
hd: _0 : nat, _0 < length (0 :: tail) → nth _0 (0 :: tail) 0 ≠ x
step3: nth 0 (<[x:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) x)]> [ReferTo 0]) (Ancestor Unit) = ReferTo 0
y: nat
hy: y < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0)
step4: S y < S (length tail) → nth y tail 0 ≠ x
g1: S (length []) = 1
c: _0 : nat, S _0 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → nth (nth _0 (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0) [ReferTo 0] (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain [ ReferTo 0] (length [ReferTo 0]) 0) 0)
b: nth 0 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 < length [ReferTo 0]
a: ancestorChain [ReferTo 0] (length [ReferTo 0]) 0 ≠ []
g: length [ReferTo 0] ≠ 0
g2: 0 < 1
g3: False

False
exact g3.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
g: length dsu ≠ 0
g1: length dsu ≠ 1

1 < length dsu
lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

_0 : nat, length dsu = S (S _0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hS: _0 : nat, length dsu = S (S _0)
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

_0 : nat, length dsu = S (S _0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu

length dsu = S (S (length dsu - 2))
lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hS: _0 : nat, length dsu = S (S _0)

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
v: nat
vv: length dsu = S (S v)

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
v: nat
vv: length dsu = S (S v)

1 < length (ancestorChain dsu (S (S v)) u)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
v: nat
vv: length dsu = S (S v)

1 < length match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: match nth _0 dsu (Ancestor Unit) with | ReferTo _1 => _0 :: ancestorChain dsu v _1 | Ancestor _ => [_0] end | Ancestor _ => [u] end
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
v: nat
vv: length dsu = S (S v)

1 < length (u :: match nth s dsu (Ancestor Unit) with | ReferTo _0 => s :: ancestorChain dsu v _0 | Ancestor _ => [s] end)
destruct (nth s dsu (Ancestor Unit)); simpl; lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: nth (nth 0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth 1 (ancestorChain dsu (length dsu) u) 0)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: nth (nth 0 (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth 1 (u :: tail) 0)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: nth u dsu (Ancestor Unit) = ReferTo (nth 0 tail 0)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: ReferTo s = ReferTo (nth 0 tail 0)

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: ReferTo s = ReferTo (nth 0 tail 0)

s = nth 0 tail 0 → nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)

s = nth 0 tail 0 → nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s

0 < length tail
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s

0 < length tail
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (u :: tail)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s

0 < length tail
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < S (length tail)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s

0 < length tail
lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

validChainToAncestor dsu tail
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
step6: validChainToAncestor dsu tail
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

validChainToAncestor dsu tail
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

tail ≠ []
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
nth 0 tail 0 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

tail ≠ []
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (u :: tail)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

tail ≠ []
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < S (length tail)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

tail ≠ []
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < S (length tail)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
cc: tail = []

False
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < S (length [])
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
cc: tail = []

False
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < 1
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
cc: tail = []

False
lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

nth 0 tail 0 < length dsu
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

s < length dsu
exact (h1 u s hs).
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

_0 : nat, S _0 < length tail → nth (nth _0 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g1: nat
g2: S g1 < length tail

nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (u :: tail) → nth (nth _0 (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (u :: tail) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g1: nat
g2: S g1 < length tail

nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (u :: tail) → nth (nth _0 (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (u :: tail) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g1: nat
g2: S g1 < length tail
d: S (S g1) < length (u :: tail) → nth (nth (S g1) (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S (S g1)) (u :: tail) 0)

nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (u :: tail) → nth (nth _0 (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (u :: tail) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g1: nat
g2: S g1 < length tail
d: S (S g1) < S (length tail) → nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)

nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (u :: tail) → nth (nth _0 (u :: tail) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (u :: tail) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g1: nat
g2: S g1 < length tail
d: S (S g1) < S (length tail) → nth (nth g1 tail 0) dsu (Ancestor Unit) = ReferTo (nth (S g1) tail 0)

S (S g1) < S (length tail)
lia.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: nat
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo e

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor e
_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: nat
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo e

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: false
e: nat
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo e

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: false
e: nat
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo e

False
exact g3.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor e

_0 : Tree, nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (nth (length (u :: tail) - 1) (u :: tail) 0) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (nth (length tail) (u :: tail) 0) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (nth (S (length tail - 1)) (u :: tail) 0) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
g3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
e: Tree
he: nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e

nth (nth (length tail - 1) tail 0) dsu (Ancestor Unit) = Ancestor e
exact he.
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
step6: validChainToAncestor dsu tail

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length (ancestorChain dsu (length dsu) s)
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = ancestorChain dsu (length dsu) s
hh: 0 < length tail
step6: validChainToAncestor dsu tail
step7: tail = ancestorChain dsu (length dsu) s

nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length tail
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = tail
hh: 0 < length tail
step6: validChainToAncestor dsu tail
step7: tail = ancestorChain dsu (length dsu) s

nth y tail 0 ≠ x
dsu: list Slot
fuel, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
IH: _0 : nat, _0 < length dsu → ( _1 : nat, _1 < length (ancestorChain dsu (length dsu) _0) → nth _1 (ancestorChain dsu (length dsu) _0) 0 ≠ x) → ancestorChain dsu fuel _0 = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) fuel _0
u: nat
h3: u < length dsu
tail: list nat
hd: _0 : nat, _0 < length (u :: tail) → nth _0 (u :: tail) 0 ≠ x
hC: ancestorChain dsu (length dsu) u = u :: tail
step1: u ≠ x
step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! u = dsu !! u
s: nat
hs: nth u dsu (Ancestor Unit) = ReferTo s
step3: nth u (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo s
y: nat
hy: y < length tail
step4: S y < S (length tail) → nth y tail 0 ≠ x
a: ancestorChain dsu (length dsu) u ≠ []
b: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
c: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
hL: 1 < length dsu
hA: 1 < length (ancestorChain dsu (length dsu) u)
hQ: s = nth 0 tail 0
step5: validChainToAncestor dsu tail → tail = tail
hh: 0 < length tail
step6: validChainToAncestor dsu tail
step7: tail = ancestorChain dsu (length dsu) s

S y < S (length tail)
lia. Qed.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain

noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain

noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b
h: a = x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b
h: a ≠ x
b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b
h: a = x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth x (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b
h: a = x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: default (Ancestor Unit) (Some (ReferTo (ancestor dsu (length dsu) x))) = ReferTo b
h: a = x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b
h: a = x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b
h: a = x

b < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b
h: a = x

ancestor dsu (length dsu) x = b → b < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b
h: a = x
d: ancestor dsu (length dsu) x = b

b < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a: nat
c: ReferTo (ancestor dsu (length dsu) x) = ReferTo (ancestor dsu (length dsu) x)
h: a = x

ancestor dsu (length dsu) x < length dsu
apply ancestorLtLength; assumption.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo b
h: a ≠ x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: default (Ancestor Unit) (dsu !! a) = ReferTo b
h: a ≠ x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a dsu (Ancestor Unit) = ReferTo b
h: a ≠ x

b < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
a, b: nat
c: nth a dsu (Ancestor Unit) = ReferTo b
h: a ≠ x

b < length dsu
exact (h1 a b c).
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) chain ++ drop t chain) 0 = u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) chain ++ drop t chain) 0 = u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) chain) 0 = u
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) []) 0 = u
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
nth 0 (take (S i) (head :: tail)) 0 = u
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) []) 0 = u
dsu: list Slot
u, x: nat
h0: (([] = [] → False) ∧ 1 ≤ (fix _0 (_1 : list Slot) : nat := match _1 with | [] => 0 | _ :: _3 => S (_0 _3) end) dsu ∧ _0 : nat, S (S _0) ≤ 0 → (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) match _0 with | 0 | _ => 0 end dsu (Ancestor Unit) = ReferTo 0) ∧ _0 : Tree, (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) 0 dsu (Ancestor Unit) = Ancestor _0
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) []) 0 = u
easy.
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

nth 0 (take (S i) (head :: tail)) 0 = u
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: head = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < S (length tail)
he: match i with | 0 => head | S _0 => nth _0 tail 0 end = x
t: nat
hT: match t with | 0 => head | S _0 => nth _0 tail 0 end = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < S (length tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (head :: take i tail ++ drop t (head :: tail)) → _0 : nat, head = _0 → head :: take i tail ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

head = u
dsu: list Slot
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (u :: tail)
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < S (length tail)
he: match i with | 0 => u | S _0 => nth _0 tail 0 end = x
t: nat
hT: match t with | 0 => u | S _0 => nth _0 tail 0 end = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < S (length tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (u :: take i tail ++ drop t (u :: tail)) → _0 : nat, u = _0 → u :: take i tail ++ drop t (u :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

u = u
reflexivity.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
step2: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain)
take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

take (S i) chain ++ drop t chain ≠ []
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth 0 (take (S i) chain ++ drop t chain) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
_0 : nat, S _0 < length (take (S i) chain ++ drop t chain) → nth (nth _0 (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S _0) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
_0 : Tree, nth (nth (length (take (S i) chain ++ drop t chain) - 1) (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

take (S i) chain ++ drop t chain ≠ []
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

take (S i) [] ++ drop t [] ≠ []
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u
take (S i) (head :: tail) ++ drop t (head :: tail) ≠ []
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

take (S i) [] ++ drop t [] ≠ []
dsu: list Slot
u, x: nat
h0: (([] = [] → False) ∧ 1 ≤ (fix _0 (_1 : list Slot) : nat := match _1 with | [] => 0 | _ :: _3 => S (_0 _3) end) dsu ∧ _0 : nat, S (S _0) ≤ 0 → (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) match _0 with | 0 | _ => 0 end dsu (Ancestor Unit) = ReferTo 0) ∧ _0 : Tree, (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) 0 dsu (Ancestor Unit) = Ancestor _0
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

take (S i) [] ++ drop t [] ≠ []
easy.
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

take (S i) (head :: tail) ++ drop t (head :: tail) ≠ []
easy.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

nth 0 (take (S i) chain ++ drop t chain) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

nth 0 (take (S i) [] ++ drop t []) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u
nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
u, x: nat
h0: validChainToAncestor dsu []
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

nth 0 (take (S i) [] ++ drop t []) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
u, x: nat
h0: (([] = [] → False) ∧ 1 ≤ (fix _0 (_1 : list Slot) : nat := match _1 with | [] => 0 | _ :: _3 => S (_0 _3) end) dsu ∧ _0 : nat, S (S _0) ≤ 0 → (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) match _0 with | 0 | _ => 0 end dsu (Ancestor Unit) = ReferTo 0) ∧ _0 : Tree, (fix _1 (_2 : nat) (_3 : list Slot) (_4 : Slot) {struct _3} : Slot := match _2 with | 0 => match _3 with | [] => _4 | _5 :: _ => _5 end | S _5 => match _3 with | [] => _4 | _ :: _7 => _1 _5 _7 _4 end end) 0 dsu (Ancestor Unit) = Ancestor _0
hV: nth 0 [] 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length []
he: nth i [] 0 = x
t: nat
hT: nth t [] 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length []
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) [] ++ drop t []) → _0 : nat, nth 0 (take (S i) [] ++ drop t []) 0 = _0 → take (S i) [] ++ drop t [] = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) [] ++ drop t []) 0 = u

nth 0 (take (S i) [] ++ drop t []) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
easy.
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: nth i (head :: tail) 0 = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: match i with | 0 => head | S _0 => nth _0 tail 0 end = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: match i with | 0 => head | S _0 => nth _0 tail 0 end = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

nth 0 (take (S i) (head :: tail)) 0 < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: nth 0 (head :: tail) 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: match i with | 0 => head | S _0 => nth _0 tail 0 end = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

head < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
head: nat
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (head :: tail)
hV: head = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length (head :: tail)
he: match i with | 0 => head | S _0 => nth _0 tail 0 end = x
t: nat
hT: nth t (head :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (head :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (head :: tail) ++ drop t (head :: tail)) → _0 : nat, nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = _0 → take (S i) (head :: tail) ++ drop t (head :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) (head :: tail) ++ drop t (head :: tail)) 0 = u

head < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (u :: tail)
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
he: match i with | 0 => u | S _0 => nth _0 tail 0 end = x
hd: i < length (u :: tail)
t: nat
hT: nth t (u :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (u :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step1: nth 0 (take (S i) (u :: tail) ++ drop t (u :: tail)) 0 = u
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (u :: tail) ++ drop t (u :: tail)) → _0 : nat, nth 0 (take (S i) (u :: tail) ++ drop t (u :: tail)) 0 = _0 → take (S i) (u :: tail) ++ drop t (u :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

u < length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot
tail: list nat
u, x: nat
h0: validChainToAncestor dsu (u :: tail)
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
he: match i with | 0 => u | S _0 => nth _0 tail 0 end = x
hd: i < length (u :: tail)
t: nat
hT: nth t (u :: tail) 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length (u :: tail)
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step1: nth 0 (take (S i) (u :: tail) ++ drop t (u :: tail)) 0 = u
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) (u :: tail) ++ drop t (u :: tail)) → _0 : nat, nth 0 (take (S i) (u :: tail) ++ drop t (u :: tail)) 0 = _0 → take (S i) (u :: tail) ++ drop t (u :: tail) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0

u < length dsu
assumption.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

_0 : nat, S _0 < length (take (S i) chain ++ drop t chain) → nth (nth _0 (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S _0) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a = i
nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a
nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i

nth (nth a (take (S i) chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ nth i chain 0

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x
step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x
step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step4: default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0) = default (Ancestor Unit) (dsu !! nth a chain 0)

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x
step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step4: nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = nth (nth a chain 0) dsu (Ancestor Unit)

nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x
step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step4: nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = nth (nth a chain 0) dsu (Ancestor Unit)

nth (nth a chain 0) dsu (Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a < i
_0: x ≠ nth a chain 0 → <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step2: nth a chain 0 ≠ x
step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! nth a chain 0 = dsu !! nth a chain 0
step4: nth (nth a chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = nth (nth a chain 0) dsu (Ancestor Unit)

S a < length chain
lia.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: a = i

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S i) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i (take (S i) chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S i) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i (take (S i) chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S i - length (take (S i) chain)) (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i (take (S i) chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S i - S i `min` length chain) (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i (take (S i) chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! (t + 0)

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (chain !! t)

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = default 0 (drop t chain !! 0)

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

nth (nth i chain 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

nth x (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! x) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

default (Ancestor Unit) (Some (ReferTo (ancestor dsu (length dsu) x))) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0
x < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

default (Ancestor Unit) (Some (ReferTo (ancestor dsu (length dsu) x))) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

ReferTo (ancestor dsu (length dsu) x) = ReferTo (nth t chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

ReferTo (ancestor dsu (length dsu) x) = ReferTo (ancestor dsu (length dsu) x)
reflexivity.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
b: S i < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
step2: drop t chain !! 0 = chain !! t
step3: nth t chain 0 = default 0 (drop t chain !! 0)
step4: nth 0 (drop t chain) 0 = nth t chain 0

x < length dsu
lia.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth a (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth (a - length (take (S i) chain)) (drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a - length (take (S i) chain)) (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth (a - S i `min` length chain) (drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a - S i `min` length chain) (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth (a - S i) (drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = ReferTo (nth (S a - S i) (drop t chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! default 0 (drop t chain !! (a - S i))) = ReferTo (default 0 (drop t chain !! (S a - S i)))
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! default 0 (chain !! (t + (a - S i)))) = ReferTo (default 0 (chain !! (t + (S a - S i))))
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

default (Ancestor Unit) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu !! default 0 (chain !! (t + (a - S i)))) = ReferTo (default 0 (chain !! S (t + (a - S i))))
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth (t + (a - S i)) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (t + (a - S i))) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a
x ≠ nth (t + (a - S i)) chain 0
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth (nth (t + (a - S i)) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (t + (a - S i))) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

S (t + (a - S i)) < length chain
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < S i + (length chain - t)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

S (t + (a - S i)) < length chain
lia.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

x ≠ nth (t + (a - S i)) chain 0
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

nth i chain 0 ≠ nth (t + (a - S i)) chain 0
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < length (take (S i) chain ++ drop t chain)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

t + (a - S i) < length chain
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
a: nat
b: S a < S i + (length chain - t)
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
l: Tree
k: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor l
hs: i < a

t + (a - S i) < length chain
lia.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

_0 : Tree, nth (nth (length (take (S i) chain ++ drop t chain) - 1) (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

_0 : Tree, nth (nth (length (take (S i) chain ++ drop t chain) - 1) (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

nth (nth (length (take (S i) chain ++ drop t chain) - 1) (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor b
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

nth (nth (length (take (S i) chain) + length (drop t chain) - 1) (take (S i) chain ++ drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor b
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

nth (nth (length (take (S i) chain) + length (drop t chain) - 1 - length (take (S i) chain)) (drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor b
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

nth (nth (length (drop t chain) - 1) (drop t chain) 0) (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (Ancestor Unit) = Ancestor b
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u

x ≠ nth (length chain - 1) chain 0
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
gg: x = nth (length chain - 1) chain 0

False
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth x dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
gg: x = nth (length chain - 1) chain 0

False
dsu: list Slot
chain: list nat
u, x: nat
e: chain ≠ []
f: nth 0 chain 0 < length dsu
g: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth x dsu (Ancestor Unit) = Ancestor b
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: false
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
gg: x = nth (length chain - 1) chain 0

False
easy.
dsu: list Slot
chain: list nat
u, x: nat
h0: validChainToAncestor dsu chain
hV: nth 0 chain 0 = u
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
i: nat
hd: i < length chain
he: nth i chain 0 = x
t: nat
hT: nth t chain 0 = ancestor dsu (length dsu) x
hT1: i < t
hT2: t < length chain
h1': noIllegalIndices (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
step: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain) → _0 : nat, nth 0 (take (S i) chain ++ drop t chain) 0 = _0 → take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) _0
step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
step2: validChainToAncestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (take (S i) chain ++ drop t chain)

take (S i) chain ++ drop t chain = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
exact (step step2 u step1). Qed.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth (length chain - 1) chain 0 = nth (length (drop s chain) - 1) (drop s chain) 0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
validChainToAncestor dsu (drop s chain)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
nth 0 (drop s chain) 0 = x
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth (length chain - 1) chain 0 = nth (length (drop s chain) - 1) (drop s chain) 0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth (length chain - 1) chain 0 = nth (length chain - 1) chain 0
reflexivity.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

validChainToAncestor dsu (drop s chain)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

drop s chain ≠ []
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
nth 0 (drop s chain) 0 < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
_0 : nat, S _0 < length (drop s chain) → nth (nth _0 (drop s chain) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (drop s chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
_0 : Tree, nth (nth (length (drop s chain) - 1) (drop s chain) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

drop s chain ≠ []
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
h: drop s chain = []

False
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
h: drop s chain = []
step1: length (drop s chain) = length []

False
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
h: drop s chain = []
step1: length chain - s = length []

False
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
h: drop s chain = []
step1: length chain - s = 0

False
lia.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth 0 (drop s chain) 0 < length dsu
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

x < length dsu
exact h4.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

_0 : nat, S _0 < length (drop s chain) → nth (nth _0 (drop s chain) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (drop s chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length (drop s chain)

nth (nth g (drop s chain) 0) dsu (Ancestor Unit) = ReferTo (nth (S g) (drop s chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length chain - s

nth (nth g (drop s chain) 0) dsu (Ancestor Unit) = ReferTo (nth (S g) (drop s chain) 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length chain - s

nth (default 0 (chain !! (s + g))) dsu (Ancestor Unit) = ReferTo (default 0 (chain !! (s + S g)))
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length chain - s

nth (nth (s + g) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (s + g)) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
e: chain ≠ []
f: nth 0 chain 0 < length dsu
j: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length chain - s

nth (nth (s + g) chain 0) dsu (Ancestor Unit) = ReferTo (nth (S (s + g)) chain 0)
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
e: chain ≠ []
f: nth 0 chain 0 < length dsu
j: _0 : nat, S _0 < length chain → nth (nth _0 chain 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) chain 0)
b: Tree
c: nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor b
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain
g: nat
i: S g < length chain - s

S (s + g) < length chain
lia.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

_0 : Tree, nth (nth (length (drop s chain) - 1) (drop s chain) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

_0 : Tree, nth (default 0 (chain !! (s + (length (drop s chain) - 1)))) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

_0 : Tree, nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
c: _0 : Tree, nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor _0
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

_0 : Tree, nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor _0
exact c.
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth 0 (drop s chain) 0 = x
dsu: list Slot
chain: list nat
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
h6: validChainToAncestor dsu chain
h7: nth 0 chain 0 = u
s: nat
h8: nth s chain 0 = x
h9: s < length chain

nth s chain 0 = x
exact h8. Qed.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: bool
hs: s = existsInRange (length (ancestorChain dsu (length dsu) u)) (λ _0 : nat, bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x))

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: bool
hs: existsInRange (length (ancestorChain dsu (length dsu) u)) (λ _0 : nat, bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)) = s

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) ∧ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x) = true

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: notExistsInRangeLogic (length (ancestorChain dsu (length dsu) u)) (λ _0 : nat, bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x))
ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) ∧ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x) = true

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: bool_decide (nth s (ancestorChain dsu (length dsu) u) 0 = x) = true

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

validChain dsu (ancestorChain dsu (length dsu) u)
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

validChain dsu (ancestorChain dsu (length dsu) u)
assumption.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Slot
hg: g = nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit)
step2: match g with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: match g with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Slot
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = g
step2: match g with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: match g with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: nat
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo g
step2: false
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: false

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Tree
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor g
step2: true
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: true
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: nat
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo g
step2: false
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: false

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: nat
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = ReferTo g
step2: false
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: false

False
exact step3.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Tree
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor g
step2: true
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: true

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Tree
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor g
step2: true
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: true

nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor g
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
g: Tree
hg: nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = Ancestor g
step2: true
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: true

nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) = nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit)
reflexivity.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s = length (ancestorChain dsu (length dsu) u) - 1

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s = length (ancestorChain dsu (length dsu) u) - 1

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hc: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = x
hb: length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u)
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S (length (ancestorChain dsu (length dsu) u) - 1)) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hc: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = x
hb: length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u)
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S (length (ancestorChain dsu (length dsu) u) - 1)) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hc: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = x
hb: length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u)
e: ancestorChain dsu (length dsu) u ≠ []
f: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
g: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
b: Tree
c: nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor b
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S (length (ancestorChain dsu (length dsu) u) - 1)) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: false
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hc: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = x
hb: length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u)
e: ancestorChain dsu (length dsu) u ≠ []
f: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
g: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
b: Tree
c: nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor b
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S (length (ancestorChain dsu (length dsu) u) - 1)) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: false
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hc: nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = x
hb: length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u)
e: ancestorChain dsu (length dsu) u ≠ []
f: nth 0 (ancestorChain dsu (length dsu) u) 0 < length dsu
g: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) u) → nth (nth _0 (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) u) 0)
b: Tree
c: nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) = Ancestor b
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S (length (ancestorChain dsu (length dsu) u) - 1)) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

False
exact h5.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
step7: take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
step7: take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u

ancestor dsu (length dsu) u = nth (length (ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u) - 1) (ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u) 0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
step7: take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u

ancestor dsu (length dsu) u = nth (length (ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u) - 1) (ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u) 0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
step7: take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u

ancestor dsu (length dsu) u = nth (S s + (length (ancestorChain dsu (length dsu) u) - (length (ancestorChain dsu (length dsu) u) - 1)) - 1 - S s) (drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u)) 0
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
s: nat
hb: s < length (ancestorChain dsu (length dsu) u)
hc: nth s (ancestorChain dsu (length dsu) u) 0 = x
step3: validChainToAncestor dsu (ancestorChain dsu (length dsu) u)
step4: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x → s < length (ancestorChain dsu (length dsu) u) - 1 → length (ancestorChain dsu (length dsu) u) - 1 < length (ancestorChain dsu (length dsu) u) → take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)) u
step5: s < length (ancestorChain dsu (length dsu) u) - 1
step6: ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
step7: take (S s) (ancestorChain dsu (length dsu) u) ++ drop (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u

ancestor dsu (length dsu) u = ancestor dsu (length dsu) u
reflexivity.
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: notExistsInRangeLogic (length (ancestorChain dsu (length dsu) u)) (λ _0 : nat, bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x))

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)

_0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)

_0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
a: nat
b: a < length (ancestorChain dsu (length dsu) u)

nth a (ancestorChain dsu (length dsu) u) 0 ≠ x
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
a: nat
b: a < length (ancestorChain dsu (length dsu) u)
c: ¬ bool_decide (nth a (ancestorChain dsu (length dsu) u) 0 = x)

nth a (ancestorChain dsu (length dsu) u) 0 ≠ x
case_bool_decide; [exfalso; exact (c ltac:(easy)) | assumption].
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (ancestor dsu (length dsu) u) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step3: ancestorChain dsu (length dsu) u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u

ancestor dsu (length dsu) u = ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u
dsu: list Slot
u, x: nat
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
h3: u < length dsu
h4: x < length dsu
h5: match nth x dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
step: validChain dsu (ancestorChain dsu (length dsu) u)
step2: match nth (nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
hs: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → ¬ bool_decide (nth _0 (ancestorChain dsu (length dsu) u) 0 = x)
hd: _0 : nat, _0 < length (ancestorChain dsu (length dsu) u) → nth _0 (ancestorChain dsu (length dsu) u) 0 ≠ x
step3: ancestorChain dsu (length dsu) u = ancestorChain (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) u

nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0 = nth (length (ancestorChain dsu (length dsu) u) - 1) (ancestorChain dsu (length dsu) u) 0
reflexivity. Qed. Fixpoint pathCompress (dsu : list Slot) (fuel : nat) (index ancestor : nat) := match fuel with | O => dsu | S fuel => match nth index dsu (Ancestor Unit) with | ReferTo x => pathCompress (<[index := ReferTo ancestor]> dsu) fuel x ancestor | Ancestor _ => dsu end end.
dsu: list Slot
a, b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e

nth d (pathCompress dsu a b c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
dsu: list Slot
a, b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e

nth d (pathCompress dsu a b c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat

(_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)

(_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 0 _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
(_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 (S a) _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)

(_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 0 _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
easy.
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)

(_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 (S a) _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e

nth d (pathCompress dsu (S a) b c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e

nth d match nth b dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[b:=ReferTo c]> dsu) a _0 c | Ancestor _ => dsu end (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: Slot
hx: x = nth b dsu (Ancestor Unit)

nth d match x with | ReferTo _0 => pathCompress (<[b:=ReferTo c]> dsu) a _0 c | Ancestor _ => dsu end (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b = d

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b = d

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
step: nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit)
hx: nth d dsu (Ancestor Unit) = ReferTo x

nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
c, d: nat
e: Tree
x: nat
hd: ReferTo x = Ancestor e
step: nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit)
hx: nth d dsu (Ancestor Unit) = ReferTo x

nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
easy.
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d

nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d
step2: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d

nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d

default (Ancestor Unit) (dsu !! d) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d

nth d dsu (Ancestor Unit) = nth d dsu (Ancestor Unit)
reflexivity.
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
hs: b ≠ d
step2: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d dsu (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
hs: b ≠ d
step2: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)

nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat
IH: (_0 : list Slot) (_1 _2 _3 : nat) (_4 : Tree), nth _3 _0 (Ancestor Unit) = Ancestor _4 → nth _3 (pathCompress _0 a _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit)
dsu: list Slot
b, c, d: nat
e: Tree
hd: nth d dsu (Ancestor Unit) = Ancestor e
x: nat
hx: nth b dsu (Ancestor Unit) = ReferTo x
step: nth d dsu (Ancestor Unit) = Ancestor e → nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c) (Ancestor Unit) = nth d dsu (Ancestor Unit)
hs: b ≠ d
step2: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) = nth d dsu (Ancestor Unit)

nth d dsu (Ancestor Unit) = nth d dsu (Ancestor Unit)
reflexivity. Qed.
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu

_0 : Tree, nth (ancestor dsu (length dsu) a) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu

_0 : Tree, nth (ancestor dsu (length dsu) a) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
step: match nth (ancestor dsu (length dsu) a) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (ancestor dsu (length dsu) a) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: nat
step: false

_0 : Tree, ReferTo g = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: Tree
step: true
_0 : Tree, Ancestor g = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: nat
step: false

_0 : Tree, ReferTo g = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: nat
step: false

False
exact step.
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: Tree
step: true

_0 : Tree, Ancestor g = Ancestor _0
dsu: list Slot
h2: withoutCyclesN dsu (length dsu)
a: nat
hA: a < length dsu
g: Tree
step: true

Ancestor g = Ancestor g
reflexivity. Qed.
dsu: list Slot
h1: noIllegalIndices dsu
fuel, a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c (pathCompress dsu fuel a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu fuel a b) (Ancestor Unit) = ReferTo b
dsu: list Slot
h1: noIllegalIndices dsu
fuel, a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c (pathCompress dsu fuel a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu fuel a b) (Ancestor Unit) = ReferTo b
fuel: nat

_0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c (pathCompress dsu 0 a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu 0 a b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
nth c (pathCompress dsu (S fuel) a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu (S fuel) a b) (Ancestor Unit) = ReferTo b
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c (pathCompress dsu 0 a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu 0 a b) (Ancestor Unit) = ReferTo b
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c dsu (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c dsu (Ancestor Unit) = ReferTo b
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c dsu (Ancestor Unit) = nth c dsu (Ancestor Unit)
reflexivity.
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c (pathCompress dsu (S fuel) a b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress dsu (S fuel) a b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu

nth c match nth a dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c match nth a dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: Slot
he: e = nth a dsu (Ancestor Unit)

nth c match e with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c match e with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: Slot
he: nth a dsu (Ancestor Unit) = e

nth c match e with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c match e with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b | Ancestor _ => dsu end (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
hs: c = a

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
hs: c ≠ a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
hs: c = a

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b: nat
hA: a < length dsu
hB: b < length dsu
hC: a < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth a (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b

nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth a dsu (Ancestor Unit) ∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b: nat
hA: a < length dsu
hB: b < length dsu
hC: a < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b ∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b

nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth a dsu (Ancestor Unit) ∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b: nat
hA: a < length dsu
hB: b < length dsu
hC: a < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b ∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b

nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
destruct hf; assumption.
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
hs: c ≠ a

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
hf: nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
hs: c ≠ a

nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = nth c dsu (Ancestor Unit) ∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b) (Ancestor Unit) = ReferTo b
exact hf.
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu

noIllegalIndices (<[a:=ReferTo b]> dsu)
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j

j < length (<[a:=ReferTo b]> dsu)
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j
hs: i = a

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j
hs: i ≠ a
j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j
hs: i = a

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
j: nat
hi: nth a (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
j: nat
hi: ReferTo b = ReferTo j

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
j: nat
hi: ReferTo b = ReferTo j

b = j → j < length dsu
lia.
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) = ReferTo j
hs: i ≠ a

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a

j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a

i < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a
hi1: i < length dsu
j < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a

i < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a
ht: length dsu ≤ i

i < length dsu
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: Ancestor Unit = ReferTo j
hs: i ≠ a
ht: length dsu ≤ i

i < length dsu
easy.
fuel: nat
IH: _0 : list Slot, noIllegalIndices _0 → _1 _2 _3 : nat, _1 < length _0 → _2 < length _0 → _3 < length _0 → nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = nth _3 _0 (Ancestor Unit) ∨ nth _3 (pathCompress _0 fuel _1 _2) (Ancestor Unit) = ReferTo _2
dsu: list Slot
h1: noIllegalIndices dsu
a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
e: nat
he: nth a dsu (Ancestor Unit) = ReferTo e
hE: e < length dsu
i, j: nat
hi: nth i dsu (Ancestor Unit) = ReferTo j
hs: i ≠ a
hi1: i < length dsu

j < length dsu
exact (h1 i _ hi). Qed.
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat

l !! n = l1 !! n
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat

l !! n = l1 !! n
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: option A
h1: target1 = l !! n

target1 = l1 !! n
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: option A
h1: target1 = l !! n
target2: option A
h2: target2 = l1 !! n

target1 = target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: option A
h1: l !! n = target1
target2: option A
h2: target2 = l1 !! n

target1 = target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: option A
h1: l !! n = target1
target2: option A
h2: l1 !! n = target2

target1 = target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: A
h1: l !! n = Some target1
target2: A
h2: l1 !! n = Some target2

Some target1 = Some target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: A
h1: l !! n = Some target1
target2: A
h2: l1 !! n = Some target2
s: n < length l

Some target1 = Some target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: A
h1: l !! n = Some target1
target2: A
h2: l1 !! n = Some target2
s: n < length l
t: nth n l d = nth n l1 d

Some target1 = Some target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: A
h1: l !! n = Some target1
target2: A
h2: l1 !! n = Some target2
s: n < length l
t: default d (Some target1) = default d (Some target2)

Some target1 = Some target2
A: Type
l, l1: list A
hL: length l = length l1
d: A
hnth: _0 : nat, _0 < length l → nth _0 l d = nth _0 l1 d
n: nat
target1: A
h1: l !! n = Some target1
target2: A
h2: l1 !! n = Some target2
s: n < length l
t: target1 = target2

Some target1 = Some target2
congruence. Qed. Definition performMerge (dsu : list Slot) (tree1 tree2 : Tree) (u v : nat) := <[u := ReferTo v]> (<[v := Ancestor (Unite tree2 tree1)]> dsu).
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (<[u:=ReferTo v]> (<[v:=Ancestor (Unite tree2 tree1)]> dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (<[u:=ReferTo v]> (take v dsu ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (<[u:=ReferTo v]> (take v dsu) ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore ((take (u `min` v) dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore ((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

dsuScore ((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

dsuScore ((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu) = (dsuScore (take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

dsuScore (take u dsu ++ [ReferTo v] ++ drop (S u) (take v dsu) ++ [Ancestor (Unite tree2 tree1)] ++ drop (S v) dsu) = (dsuScore (take u dsu ++ [Ancestor tree1] ++ drop (S u) (take v dsu) ++ [Ancestor tree2] ++ drop (v + 1) dsu) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take u dsu ++ [ReferTo v] ++ drop (S u) (take v dsu) ++ [Ancestor (Unite tree2 tree1)] ++ drop (S v) dsu))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take u dsu ++ [Ancestor tree1] ++ drop (S u) (take v dsu) ++ [Ancestor tree2] ++ drop (v + 1) dsu))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take u dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo v]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor (Unite tree2 tree1)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S v) dsu)))))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take u dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) [Ancestor tree1]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) [Ancestor tree2]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (v + 1) dsu)))))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take u dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (leafCount tree2 + leafCount tree1 + score tree2 + score tree1 + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S v) dsu))))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take u dsu)) + (score tree1 + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (score tree2 + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (v + 1) dsu)))))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u < v
hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: dsu = take u dsu ++ [nth u dsu (Ancestor Unit)] ++ drop (S u) (take v dsu) ++ [nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take u dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (leafCount tree2 + leafCount tree1 + score tree2 + score tree1 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S v) dsu))))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take u dsu)) + (score tree1 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S u) (take v dsu))) + (score tree2 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S v) dsu)))))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
lia. Qed.
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (<[u:=ReferTo v]> (<[v:=Ancestor (Unite tree2 tree1)]> dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (<[u:=ReferTo v]> (take v dsu ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

(_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
dsuScore (<[u:=ReferTo v]> (take v dsu ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

(_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: Slot
b: list Slot

<[u:=a]> b = <[length (take v dsu) + (u - v):=a]> b
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
a: Slot
b: list Slot

<[u:=a]> b = <[u:=a]> b
reflexivity.
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

dsuScore (<[u:=ReferTo v]> (take v dsu ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

dsuScore (<[length (take v dsu) + (u - v):= ReferTo v]> (take v dsu ++ Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

dsuScore (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ <[u - v - 1:=ReferTo v]> (drop (S v) dsu)) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

dsuScore (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ take (u - v - 1) (drop (S v) dsu) ++ ReferTo v :: drop (S v + S (u - v - 1)) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

dsuScore (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ take (u - v - 1) (drop (S v) dsu) ++ [ReferTo v] ++ drop (u + 1) dsu) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ take (u - v - 1) (drop (S v) dsu) ++ [ReferTo v] ++ drop (u + 1) dsu))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) dsu)) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
a: dsu = take v dsu ++ [nth v dsu (Ancestor Unit)] ++ drop (S v) (take u dsu) ++ [nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ take (u - v - 1) (drop (S v) dsu) ++ [ReferTo v] ++ drop (u + 1) dsu))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) dsu)) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
a: dsu = take v dsu ++ [nth v dsu (Ancestor Unit)] ++ drop (S v) (take u dsu) ++ [nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take v dsu ++ [Ancestor (Unite tree2 tree1)] ++ take (u - v - 1) (drop (S v) dsu) ++ [ReferTo v] ++ drop (u + 1) dsu))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take v dsu ++ [nth v dsu (Ancestor Unit)] ++ drop (S v) (take u dsu) ++ [nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
a: dsu = take v dsu ++ [nth v dsu (Ancestor Unit)] ++ drop (S v) (take u dsu) ++ [nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take v dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor (Unite tree2 tree1)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S v) (take u dsu))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo v]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (u + 1) dsu)))))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take v dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) [Ancestor tree2]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S v) (take u dsu))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) [Ancestor tree1]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (u + 1) dsu)))))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: v < u
hL: u < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
h: (_0 : Slot) (_1 : list Slot), <[u:=_0]> _1 = <[length (take v dsu) + (u - v):=_0]> _1
a: dsu = take v dsu ++ [nth v dsu (Ancestor Unit)] ++ drop (S v) (take u dsu) ++ [nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take v dsu)) + (leafCount tree2 + leafCount tree1 + score tree2 + score tree1 + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S v) (take u dsu))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (u + 1) dsu))))) = (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (take v dsu)) + (score tree2 + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (S v) (take u dsu))) + (score tree1 + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => score _1 end) (drop (u + 1) dsu)))))) + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
lia. Qed.
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
hs: u < v

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
hs: v < u
dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
hs: u < v

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
apply performMergeScore'; assumption.
dsu: list Slot
tree1, tree2: Tree
u, v: nat
hUV: u ≠ v
hLt1: u < length dsu
hLt2, hL: v < length dsu
hU: nth u dsu (Ancestor Unit) = Ancestor tree1
hV: nth v dsu (Ancestor Unit) = Ancestor tree2
hs: v < u

dsuScore (performMerge dsu tree1 tree2 u v) = (dsuScore dsu + Z.of_nat (leafCount tree1) + Z.of_nat (leafCount tree2))%Z
apply performMergeScore''; assumption. Qed. Definition unite (dsu : list Slot) (a b : nat) := if decide (length dsu <= a) then dsu else if decide (length dsu <= b) then dsu else let u := ancestor dsu (length dsu) a in let dsu1 := pathCompress dsu (length dsu) a u in let v := ancestor dsu1 (length dsu1) b in let dsu2 := pathCompress dsu1 (length dsu1) b v in if decide (u = v) then dsu2 else match nth u dsu2 (Ancestor Unit) with | ReferTo _ => dsu2 | Ancestor tree1 => match nth v dsu2 (Ancestor Unit) with | ReferTo _ => dsu2 | Ancestor tree2 => if decide (leafCount tree2 < leafCount tree1) then performMerge dsu2 tree2 tree1 v u else performMerge dsu2 tree1 tree2 u v end end. Fixpoint dsuFromInteractions (dsu : list Slot) (interactions : list (nat * nat)) := match interactions with | [] => dsu | (a, b)::tail => if decide (a < length dsu /\ b < length dsu) then dsuFromInteractions (unite dsu a b) tail else dsuFromInteractions dsu tail end.
dsu: list Slot
n, a, b: nat

length (pathCompress dsu n a b) = length dsu
dsu: list Slot
n, a, b: nat

length (pathCompress dsu n a b) = length dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), length (pathCompress _0 n _1 b) = length _0

length (pathCompress dsu (S n) a b) = length dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), length (pathCompress _0 n _1 b) = length _0

length match nth a dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = length dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), length (pathCompress _0 n _1 b) = length _0
x: nat

length (pathCompress (<[a:=ReferTo b]> dsu) n x b) = length dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), length (pathCompress _0 n _1 b) = length _0
x: nat

length (<[a:=ReferTo b]> dsu) = length dsu
apply insert_length. Qed.
dsu: list Slot
n, a, b: nat

dsuScore (pathCompress dsu n a b) = dsuScore dsu
dsu: list Slot
n, a, b: nat

dsuScore (pathCompress dsu n a b) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0

dsuScore (pathCompress dsu (S n) a b) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0

dsuScore match nth a dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: Slot
hx: x = nth a dsu (Ancestor Unit)

dsuScore match x with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: Slot
hx: nth a dsu (Ancestor Unit) = x

dsuScore match x with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x

dsuScore (pathCompress (<[a:=ReferTo b]> dsu) n x b) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x

dsuScore (<[a:=ReferTo b]> dsu) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

dsuScore (<[a:=ReferTo b]> dsu) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

dsuScore (take a dsu ++ ReferTo b :: drop (S a) dsu) = dsuScore dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take a dsu ++ ReferTo b :: drop (S a) dsu))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take a dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S a) dsu)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])
Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take a dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S a) dsu)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo x])
easy.
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (take a dsu)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (drop (S a) dsu)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu)) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])
a < length dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu)) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) dsu))
reflexivity.
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuScore (pathCompress _0 n _1 b) = dsuScore _0
x: nat
hx: nth a dsu (Ancestor Unit) = ReferTo x
ha: a < length dsu
s: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo b]) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [nth a dsu (Ancestor Unit)])

a < length dsu
exact ha. Qed.
dsu: list Slot
n, a, b: nat

dsuLeafCount (pathCompress dsu n a b) = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat

dsuLeafCount (pathCompress dsu n a b) = dsuLeafCount dsu
dsu: list Slot
a, b: nat

dsuLeafCount (pathCompress dsu 0 a b) = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0
dsuLeafCount (pathCompress dsu (S n) a b) = dsuLeafCount dsu
dsu: list Slot
a, b: nat

dsuLeafCount (pathCompress dsu 0 a b) = dsuLeafCount dsu
easy.
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0

dsuLeafCount (pathCompress dsu (S n) a b) = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0

dsuLeafCount match nth a dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0
x: Slot
hX: x = nth a dsu (Ancestor Unit)

dsuLeafCount match x with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0
x: Slot
hX: nth a dsu (Ancestor Unit) = x

dsuLeafCount match x with | ReferTo _0 => pathCompress (<[a:=ReferTo b]> dsu) n _0 b | Ancestor _ => dsu end = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0
x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x

dsuLeafCount (pathCompress (<[a:=ReferTo b]> dsu) n x b) = dsuLeafCount dsu
dsu: list Slot
n, a, b: nat
IH: (_0 : list Slot) (_1 : nat), dsuLeafCount (pathCompress _0 n _1 b) = dsuLeafCount _0
x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x

dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x

dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: length dsu ≤ a

dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a
dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: length dsu ≤ a

dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
rewrite list_insert_ge; lia.
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

dsuLeafCount (<[a:=ReferTo b]> dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

dsuLeafCount (take a dsu ++ ReferTo b :: drop (S a) dsu) = dsuLeafCount dsu
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu ++ ReferTo b :: drop (S a) dsu))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu))
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu ++ ReferTo b :: drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (ReferTo b :: drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take a dsu)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take a dsu ++ [nth a dsu (Ancestor Unit)]) ++ drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

(_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a
H1: (_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1
list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take a dsu ++ [nth a dsu (Ancestor Unit)]) ++ drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a

(_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1

(_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1
T: Type
l: list T
i: nat
default: T
H: i < length l

take i l ++ [nth i l default] = take (S i) l
T: Type
l: list T
i: nat
default: T

i < length l → take i l ++ [nth i l default] = take (S i) l
T: Type
i: nat
default: T

_0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
T: Type
default: T
l: list T
H: 0 < length l

take 0 l ++ [nth 0 l default] = take 1 l
T: Type
i: nat
default: T
IHi: _0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
l: list T
H: S i < length l
take (S i) l ++ [nth (S i) l default] = take (S (S i)) l
T: Type
default: T
l: list T
H: 0 < length l

take 0 l ++ [nth 0 l default] = take 1 l
T: Type
default: T
l: list T
H: 0 < length l

[] ++ [nth 0 l default] = take 1 l
T: Type
default, _0: T
_1: list T
H: 0 < S (length _1)

[_0] = _0 :: take 0 _1
T: Type
default, _0: T
_1: list T
H: 0 < S (length _1)

[_0] = [_0]
reflexivity.
T: Type
i: nat
default: T
IHi: _0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
l: list T
H: S i < length l

take (S i) l ++ [nth (S i) l default] = take (S (S i)) l
T: Type
i: nat
default: T
IHi: _0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
_0: T
_1: list T
H: S i < S (length _1)

take (S i) (_0 :: _1) ++ [nth (S i) (_0 :: _1) default] = take (S (S i)) (_0 :: _1)
T: Type
i: nat
default: T
IHi: _0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
_0: T
_1: list T
H: S i < S (length _1)

_0 :: take i _1 ++ [nth i _1 default] = _0 :: take (S i) _1
T: Type
i: nat
default: T
IHi: _0 : list T, i < length _0 → take i _0 ++ [nth i _0 default] = take (S i) _0
_0: T
_1: list T
H: S i < S (length _1)

_0 :: take (S i) _1 = _0 :: take (S i) _1
reflexivity.
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a
H1: (_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take a dsu ++ [nth a dsu (Ancestor Unit)]) ++ drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a
H1: (_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take (S a) dsu ++ drop (S a) dsu)) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
dsu: list Slot
a, b, x: nat
hX: nth a dsu (Ancestor Unit) = ReferTo x
hL: ¬ length dsu ≤ a
H1: (_0 : Type) (_1 : list _0) (_2 : nat) (_3 : _0), _2 < length _1 → take _2 _1 ++ [nth _2 _1 _3] = take (S _2) _1

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu) = list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)
reflexivity. Qed.
dsu: list Slot
h1: noIllegalIndices dsu
n, u, v: nat
hU: u < length dsu
hV: v < length dsu

noIllegalIndices (pathCompress dsu n u v)
dsu: list Slot
h1: noIllegalIndices dsu
n, u, v: nat
hU: u < length dsu
hV: v < length dsu

noIllegalIndices (pathCompress dsu n u v)
dsu: list Slot
h1: noIllegalIndices dsu
n, v: nat
hV: v < length dsu

_0 : nat, _0 < length dsu → noIllegalIndices (pathCompress dsu n _0 v)
dsu: list Slot
n, v: nat
hV: v < length dsu

noIllegalIndices dsu → _0 : nat, _0 < length dsu → noIllegalIndices (pathCompress dsu n _0 v)
dsu: list Slot
n, v: nat

v < length dsu → noIllegalIndices dsu → _0 : nat, _0 < length dsu → noIllegalIndices (pathCompress dsu n _0 v)
n, v: nat

_0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
v: nat
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices (pathCompress dsu 0 u v)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
noIllegalIndices (pathCompress dsu (S n) u v)
v: nat
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices (pathCompress dsu 0 u v)
v: nat
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices dsu
v: nat
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices dsu
exact h1.
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices (pathCompress dsu (S n) u v)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

noIllegalIndices match nth u dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
hi: nth i match nth u dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end (Ancestor Unit) = ReferTo j

j < length match nth u dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
e: Slot
he: e = nth u dsu (Ancestor Unit)
hi: nth i match e with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end (Ancestor Unit) = ReferTo j

j < length match e with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
e: Slot
he: nth u dsu (Ancestor Unit) = e
hi: nth i match e with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end (Ancestor Unit) = ReferTo j

j < length match e with | ReferTo _0 => pathCompress (<[u:=ReferTo v]> dsu) n _0 v | Ancestor _ => dsu end
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j

j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
e: Tree
he: nth u dsu (Ancestor Unit) = Ancestor e
hi: nth i dsu (Ancestor Unit) = ReferTo j
j < length dsu
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j

j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j

noIllegalIndices (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
h: noIllegalIndices (<[u:=ReferTo v]> dsu)
j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j

noIllegalIndices (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b

b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b
ha: a = u

b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b
ha: a ≠ u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b
ha: a = u

b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: ReferTo v = ReferTo b
ha: a = u

b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: ReferTo v = ReferTo b
ha: a = u

v = b → b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: ReferTo v = ReferTo b
ha: a = u
d: v = b

b < length (<[u:=ReferTo v]> dsu)
n, b: nat
c: ReferTo b = ReferTo b
IH: _0 : list Slot, b < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 b)
dsu: list Slot
hV: b < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo b]> dsu) n e b) (Ancestor Unit) = ReferTo j
a: nat
ha: a = u

b < length (<[u:=ReferTo b]> dsu)
n, b: nat
c: ReferTo b = ReferTo b
IH: _0 : list Slot, b < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 b)
dsu: list Slot
hV: b < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo b]> dsu) n e b) (Ancestor Unit) = ReferTo j
a: nat
ha: a = u

b < length dsu
exact hV.
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b
ha: a ≠ u

b < length (<[u:=ReferTo v]> dsu)
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) = ReferTo b
ha: a ≠ u

b < length dsu
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: default (Ancestor Unit) (dsu !! a) = ReferTo b
ha: a ≠ u

b < length dsu
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
a, b: nat
c: nth a dsu (Ancestor Unit) = ReferTo b
ha: a ≠ u

b < length dsu
exact (h1 _ _ c).
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j, e: nat
he: nth u dsu (Ancestor Unit) = ReferTo e
hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v) (Ancestor Unit) = ReferTo j
h: noIllegalIndices (<[u:=ReferTo v]> dsu)

j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
exact (IH (<[u:=ReferTo v]> dsu) ltac:(rewrite insert_length; exact hV) h e ltac:(rewrite insert_length; exact (h1 _ _ he)) i _ hi).
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
e: Tree
he: nth u dsu (Ancestor Unit) = Ancestor e
hi: nth i dsu (Ancestor Unit) = ReferTo j

j < length dsu
n, v: nat
IH: _0 : list Slot, v < length _0 → noIllegalIndices _0 → _1 : nat, _1 < length _0 → noIllegalIndices (pathCompress _0 n _1 v)
dsu: list Slot
hV: v < length dsu
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
i, j: nat
e: Tree
he: nth u dsu (Ancestor Unit) = Ancestor e
hi: nth i dsu (Ancestor Unit) = ReferTo j
_0: j < length dsu

j < length dsu
assumption. Qed.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu

withoutCyclesN (pathCompress dsu n u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu

withoutCyclesN (pathCompress dsu n u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

withoutCyclesN (pathCompress dsu 0 u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
withoutCyclesN (pathCompress dsu (S n) u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

withoutCyclesN (pathCompress dsu 0 u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu

withoutCyclesN dsu (length dsu)
assumption.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)

withoutCyclesN (pathCompress dsu (S n) u (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)

withoutCyclesN match nth u dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n _0 (ancestor dsu (length dsu) u) | Ancestor _ => dsu end (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: Slot
hX: x = nth u dsu (Ancestor Unit)

withoutCyclesN match x with | ReferTo _0 => pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n _0 (ancestor dsu (length dsu) u) | Ancestor _ => dsu end (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)) x)) (length (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu))

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)

u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)

u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
dsu: list Slot
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)

withoutCyclesN dsu (length dsu) → noIllegalIndices dsu → ReferTo x = nth u dsu (Ancestor Unit) → u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
dsu: list Slot
u, x: nat

withoutCyclesN dsu (length dsu) → noIllegalIndices dsu → ReferTo x = nth u dsu (Ancestor Unit) → u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
dsu: list Slot
u, x: nat
h1: withoutCyclesN dsu (length dsu)
h2: noIllegalIndices dsu
h3: ReferTo x = nth u dsu (Ancestor Unit)
h4: u < length dsu
h5: x < length dsu

ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
dsu: list Slot
u, x: nat
h1: withoutCyclesN dsu (length dsu)
h2: noIllegalIndices dsu
h3: ReferTo x = nth u dsu (Ancestor Unit)
h4: u < length dsu
h5: x < length dsu

match nth u dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
dsu: list Slot
u, x: nat
h1: withoutCyclesN dsu (length dsu)
h2: noIllegalIndices dsu
h3: ReferTo x = nth u dsu (Ancestor Unit)
h4: u < length dsu
h5: x < length dsu

true
easy.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Slot
hS: s = nth x dsu (Ancestor Unit)

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Slot
hS: nth x dsu (Ancestor Unit) = s

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
nth 1 (ancestorChain dsu (length dsu) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu

match nth (ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i = u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i ≠ u
match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i = u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i = u
hj: match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i = u
hj: false

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i = u
hj: false

False
exact hj.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i ≠ u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i ≠ u

match default (Ancestor Unit) (dsu !! ancestor dsu (length dsu) i) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i ≠ u

match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
i: nat
hi: i < length dsu
hA: ancestor dsu (length dsu) i ≠ u

i < length dsu
assumption.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

nth 1 (ancestorChain dsu (length dsu) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

2 ≤ length dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nth 1 (ancestorChain dsu (length dsu) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

2 ≤ length dsu
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: nat
hS: nth x (head :: tail) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: tail) (length (head :: tail)) u) 0 = x → 1 < length (ancestorChain (head :: tail) (length (head :: tail)) u) → ancestor (head :: tail) (length (head :: tail)) u = ancestor (head :: tail) (length (head :: tail)) x
2 ≤ length (head :: tail)
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < 0
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
lia.
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: nat
hS: nth x (head :: tail) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: tail) (length (head :: tail)) u) 0 = x → 1 < length (ancestorChain (head :: tail) (length (head :: tail)) u) → ancestor (head :: tail) (length (head :: tail)) u = ancestor (head :: tail) (length (head :: tail)) x

2 ≤ length (head :: tail)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
2 ≤ length (head :: _0 :: _1)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x
_0: u = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = nth 0 [head] (Ancestor Unit)
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x
_0: x = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: nth 0 [head] (Ancestor Unit) = ReferTo s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: match nth (ancestor [head] (length [head]) 0) [head] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: head = ReferTo s
step3: match match match head with | ReferTo _0 => _0 | Ancestor _ => 0 end with | 0 => head | _ => Ancestor Unit end with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: nat
step3: false
hS: ReferTo 0 = ReferTo s
step2: nth 1 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 = 01 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → ancestor [ReferTo 0] (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0

2 ≤ length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: nat
step3: false
hS: ReferTo 0 = ReferTo s
step2: nth 1 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 = 01 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → ancestor [ReferTo 0] (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0

False
exact step3.
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x

2 ≤ length (head :: _0 :: _1)
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x

2 ≤ S (S (length _1))
lia.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu

nth 1 (ancestorChain dsu (length dsu) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

nth 1 (ancestorChain dsu (length dsu) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

nth 1 (ancestorChain dsu (S (S nn)) u) 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

nth 1 match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: match nth _0 dsu (Ancestor Unit) with | ReferTo _1 => _0 :: ancestorChain dsu nn _1 | Ancestor _ => [_0] end | Ancestor _ => [u] end 0 = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

nth 1 (u :: x :: ancestorChain dsu nn s) 0 = x
easy.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

2 ≤ length dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x

2 ≤ length dsu
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: nat
hS: nth x (head :: tail) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: tail) (length (head :: tail)) u) 0 = x → 1 < length (ancestorChain (head :: tail) (length (head :: tail)) u) → ancestor (head :: tail) (length (head :: tail)) u = ancestor (head :: tail) (length (head :: tail)) x
2 ≤ length (head :: tail)
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < 0
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: nat
hS: nth x [] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [] (length []) u) 0 = x → 1 < length (ancestorChain [] (length []) u) → ancestor [] (length []) u = ancestor [] (length []) x

2 ≤ length []
lia.
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: nat
hS: nth x (head :: tail) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: tail) (length (head :: tail)) u) 0 = x → 1 < length (ancestorChain (head :: tail) (length (head :: tail)) u) → ancestor (head :: tail) (length (head :: tail)) u = ancestor (head :: tail) (length (head :: tail)) x

2 ≤ length (head :: tail)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
2 ≤ length (head :: _0 :: _1)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) u) 0 = x → 1 < length (ancestorChain [head] (length [head]) u) → ancestor [head] (length [head]) u = ancestor [head] (length [head]) x
_0: u = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = nth 0 [head] (Ancestor Unit)
hX1: x < length [head]
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: nat
hS: nth x [head] (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = x → 1 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) x
_0: x = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: nth 0 [head] (Ancestor Unit) = ReferTo s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: nth 0 [head] (Ancestor Unit) = ReferTo s
step3: match nth (ancestor [head] (length [head]) 0) [head] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: nat
step2: nth 1 (ancestorChain [head] (length [head]) 0) 0 = 01 < length (ancestorChain [head] (length [head]) 0) → ancestor [head] (length [head]) 0 = ancestor [head] (length [head]) 0
hS: head = ReferTo s
step3: match match match head with | ReferTo _0 => _0 | Ancestor _ => 0 end with | 0 => head | _ => Ancestor Unit end with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: nat
step3: false
hS: ReferTo 0 = ReferTo s
step2: nth 1 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 = 01 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → ancestor [ReferTo 0] (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0

2 ≤ length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: nat
step3: false
hS: ReferTo 0 = ReferTo s
step2: nth 1 (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) 0 = 01 < length (ancestorChain [ReferTo 0] (length [ReferTo 0]) 0) → ancestor [ReferTo 0] (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0

False
exact step3.
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x

2 ≤ length (head :: _0 :: _1)
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: nat
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) 0 = x → 1 < length (ancestorChain (head :: _0 :: _1) (length (head :: _0 :: _1)) u) → ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x

2 ≤ S (S (length _1))
lia.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

1 < length (ancestorChain dsu (S (S nn)) u)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

1 < length match nth u dsu (Ancestor Unit) with | ReferTo _0 => u :: match nth _0 dsu (Ancestor Unit) with | ReferTo _1 => _0 :: ancestorChain dsu nn _1 | Ancestor _ => [_0] end | Ancestor _ => [u] end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

1 < length (u :: x :: ancestorChain dsu nn s)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: nat
hS: nth x dsu (Ancestor Unit) = ReferTo s
step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x → 1 < length (ancestorChain dsu (length dsu) u) → ancestor dsu (length dsu) u = ancestor dsu (length dsu) x
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

1 < S (S (length (ancestorChain dsu nn s)))
lia.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s

2 ≤ length dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s

2 ≤ length dsu
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: Tree
hS: nth x [] (Ancestor Unit) = Ancestor s

2 ≤ length []
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: Tree
hS: nth x (head :: tail) (Ancestor Unit) = Ancestor s
2 ≤ length (head :: tail)
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < length []
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: Tree
hS: nth x [] (Ancestor Unit) = Ancestor s

2 ≤ length []
h: withoutCyclesN [] (length [])
h1: noIllegalIndices []
n, u: nat
hU: u < 0
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [] (length []) u)]> []) n x (ancestor [] (length []) x)) (length [])
step1: u < length [] → x < length [] → ancestor (<[u:=ReferTo (ancestor [] (length []) u)]> []) (length []) x = ancestor [] (length []) x
hX1: x < length []
s: Tree
hS: nth x [] (Ancestor Unit) = Ancestor s

2 ≤ length []
lia.
head: Slot
tail: list Slot
h: withoutCyclesN (head :: tail) (length (head :: tail))
h1: noIllegalIndices (head :: tail)
n, u: nat
hU: u < length (head :: tail)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: tail) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) n x (ancestor (head :: tail) (length (head :: tail)) x)) (length (head :: tail))
step1: u < length (head :: tail) → x < length (head :: tail) → ancestor (<[u:=ReferTo (ancestor (head :: tail) (length (head :: tail)) u)]> (head :: tail)) (length (head :: tail)) x = ancestor (head :: tail) (length (head :: tail)) x
hX1: x < length (head :: tail)
s: Tree
hS: nth x (head :: tail) (Ancestor Unit) = Ancestor s

2 ≤ length (head :: tail)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: Tree
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = Ancestor s
2 ≤ length (head :: _0 :: _1)
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < length [head]
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n, u: nat
hU: u < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u [head] (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
step1: u < length [head] → x < length [head] → ancestor (<[u:=ReferTo (ancestor [head] (length [head]) u)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
hX1: x < length [head]
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s
_0: u = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = nth 0 [head] (Ancestor Unit)
hX1: x < length [head]
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
step1: 0 < length [head] → x < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) x = ancestor [head] (length [head]) x
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n x (ancestor [head] (length [head]) x)) (length [head])
hX: ReferTo x = head
hX1: x < 1
s: Tree
hS: nth x [head] (Ancestor Unit) = Ancestor s
_0: x = 0

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: Tree
hS: nth 0 [head] (Ancestor Unit) = Ancestor s

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: Tree
hS: nth 0 [head] (Ancestor Unit) = Ancestor s
step3: match nth (ancestor [head] (length [head]) 0) [head] (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
head: Slot
h: withoutCyclesN [head] (length [head])
h1: noIllegalIndices [head]
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
hX: ReferTo 0 = head
step: withoutCyclesN (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) n 0 (ancestor [head] (length [head]) 0)) (length [head])
step1: 0 < length [head] → 0 < length [head] → ancestor (<[0:=ReferTo (ancestor [head] (length [head]) 0)]> [head]) (length [head]) 0 = ancestor [head] (length [head]) 0
s: Tree
hS: head = Ancestor s
step3: match match match head with | ReferTo _0 => _0 | Ancestor _ => 0 end with | 0 => head | _ => Ancestor Unit end with | ReferTo _ => false | Ancestor _ => true end

2 ≤ length [head]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: Tree
step3: false
hS: ReferTo 0 = Ancestor s

2 ≤ length [ReferTo 0]
h1: noIllegalIndices [ReferTo 0]
h: withoutCyclesN [ReferTo 0] (length [ReferTo 0])
n: nat
hU: 0 < 1
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
hX1: 0 < 1
step1: 0 < length [ReferTo 0] → 0 < length [ReferTo 0] → ancestor (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) 0 = ancestor [ReferTo 0] (length [ReferTo 0]) 0
step: withoutCyclesN (<[0:=ReferTo (ancestor [ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) (length [ReferTo 0]) → withoutCyclesN (pathCompress (<[0:=ReferTo (ancestor [ ReferTo 0] (length [ReferTo 0]) 0)]> [ReferTo 0]) n 0 (ancestor [ReferTo 0] (length [ReferTo 0]) 0)) (length [ReferTo 0])
s: Tree
step3: false
hS: ReferTo 0 = Ancestor s

False
exact step3.
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: Tree
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = Ancestor s

2 ≤ length (head :: _0 :: _1)
head, _0: Slot
_1: list Slot
h: withoutCyclesN (head :: _0 :: _1) (length (head :: _0 :: _1))
h1: noIllegalIndices (head :: _0 :: _1)
n, u: nat
hU: u < length (head :: _0 :: _1)
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u (head :: _0 :: _1) (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) n x (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x)) (length (head :: _0 :: _1))
step1: u < length (head :: _0 :: _1) → x < length (head :: _0 :: _1) → ancestor (<[u:=ReferTo (ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) u)]> (head :: _0 :: _1)) (length (head :: _0 :: _1)) x = ancestor (head :: _0 :: _1) (length (head :: _0 :: _1)) x
hX1: x < length (head :: _0 :: _1)
s: Tree
hS: nth x (head :: _0 :: _1) (Ancestor Unit) = Ancestor s

2 ≤ S (S (length _1))
lia.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

ancestor dsu (length dsu) u = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

ancestor dsu (length dsu) u = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

ancestor dsu (S (S nn)) u = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

match nth u dsu (Ancestor Unit) with | ReferTo _0 => match nth _0 dsu (Ancestor Unit) with | ReferTo _1 => ancestor dsu nn _1 | Ancestor _ => _0 end | Ancestor _ => u end = x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)

x = x
reflexivity.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) u)) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

withoutCyclesN (pathCompress (<[u:=ReferTo x]> dsu) n x x) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

pathCompress (<[u:=ReferTo x]> dsu) n x x = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hh: pathCompress (<[u:=ReferTo x]> dsu) n x x = <[u:=ReferTo x]> dsu
withoutCyclesN (pathCompress (<[u:=ReferTo x]> dsu) n x x) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

pathCompress (<[u:=ReferTo x]> dsu) n x x = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 0 _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) 0 x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

pathCompress (<[u:=ReferTo x]> dsu) 0 x x = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) (S _0) x x = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 0 _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) 0 x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

pathCompress (<[u:=ReferTo x]> dsu) 0 x x = <[u:=ReferTo x]> dsu
easy.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

pathCompress (<[u:=ReferTo x]> dsu) (S _0) x x = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

match nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[u:=ReferTo x]> dsu end = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u = x

match nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[u:=ReferTo x]> dsu end = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x
match nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[u:=ReferTo x]> dsu end = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u = x

match nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[u:=ReferTo x]> dsu end = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, x: nat
step1: x < length dsu → x < length dsu → ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
step: withoutCyclesN (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
hX: ReferTo x = nth x dsu (Ancestor Unit)
hU: x < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) x = x

match nth x (<[x:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[x:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[x:=ReferTo x]> dsu end = <[x:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, x: nat
step1: x < length dsu → x < length dsu → ancestor (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
step: withoutCyclesN (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
s: Tree
hX: ReferTo x = Ancestor s
hU: x < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
hX1: x < length dsu
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) x = x

match nth x (<[x:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[x:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[x:=ReferTo x]> dsu end = <[x:=ReferTo x]> dsu
easy.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x

match nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _1 => pathCompress (<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1 x | Ancestor _ => <[u:=ReferTo x]> dsu end = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x

<[u:=ReferTo x]> dsu = <[u:=ReferTo x]> dsu
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x
u ≠ x
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x

<[u:=ReferTo x]> dsu = <[u:=ReferTo x]> dsu
reflexivity.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
_0, u: nat
hU: u < length dsu
IH: _1 : list Slot, withoutCyclesN _1 (length _1) → noIllegalIndices _1 → _2 : nat, _2 < length _1 → withoutCyclesN (pathCompress _1 (S _0) _2 (ancestor _1 (length _1) _2)) (length _1)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (S _0) x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hd: u ≠ x

u ≠ x
assumption.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hh: pathCompress (<[u:=ReferTo x]> dsu) n x x = <[u:=ReferTo x]> dsu

withoutCyclesN (pathCompress (<[u:=ReferTo x]> dsu) n x x) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
hh: pathCompress (<[u:=ReferTo x]> dsu) n x x = <[u:=ReferTo x]> dsu

withoutCyclesN (<[u:=ReferTo x]> dsu) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x

withoutCyclesN (<[u:=ReferTo x]> dsu) (length dsu)
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu

match nth (ancestor (<[u:=ReferTo x]> dsu) (length (<[u:=ReferTo x]> dsu)) i) (<[u:=ReferTo x]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i = u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i ≠ u
match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i = u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i = u
step2: match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i = u
step2: false

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i = u
step2: false

False
exact step2.
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i ≠ u

match nth (ancestor dsu (length dsu) i) (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i ≠ u

match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
h: withoutCyclesN dsu (length dsu)
h1: noIllegalIndices dsu
n, u: nat
hU: u < length dsu
IH: _0 : list Slot, withoutCyclesN _0 (length _0) → noIllegalIndices _0 → _1 : nat, _1 < length _0 → withoutCyclesN (pathCompress _0 n _1 (ancestor _0 (length _0) _1)) (length _0)
x: nat
hX: ReferTo x = nth u dsu (Ancestor Unit)
step: withoutCyclesN (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) → withoutCyclesN (pathCompress (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) n x (ancestor dsu (length dsu) x)) (length dsu)
step1: u < length dsu → x < length dsu → ancestor (<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu) (length dsu) x = ancestor dsu (length dsu) x
hX1: x < length dsu
s: Tree
hS: nth x dsu (Ancestor Unit) = Ancestor s
ht: 2 ≤ length dsu
nn: nat
hn: length dsu = S (S nn)
hg: ancestor dsu (length dsu) u = x
i: nat
hh: i < length dsu
hs: ancestor dsu (length dsu) i ≠ u
step2: match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
exact step2. Qed.
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
n, a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a

ancestor (pathCompress dsu n c (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
n, a, b, c: nat
hA: a < length dsu
hB: b < length dsu
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a

ancestor (pathCompress dsu n c (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat

_0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
a, b: nat

_0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 0 _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
_0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 (S n) _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
a, b: nat

_0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 0 _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
easy.
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b

_0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 (S n) _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a

ancestor (pathCompress dsu (S n) c (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a

ancestor match nth c dsu (Ancestor Unit) with | ReferTo _0 => pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n _0 (ancestor dsu (length dsu) a) | Ancestor _ => dsu end (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: Slot
hx: x = nth c dsu (Ancestor Unit)

ancestor match x with | ReferTo _0 => pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n _0 (ancestor dsu (length dsu) a) | Ancestor _ => dsu end (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x

match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x

match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x

true
easy.
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)) → a < length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → b < length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → x < length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → ancestor (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)) x = ancestor (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) (length (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu)) a)) (length (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu)) b = ancestor (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu)) b

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (pathCompress dsu 1 c (ancestor dsu (length dsu) a))

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices match nth c dsu (Ancestor Unit) with | ReferTo _ => <[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu | Ancestor _ => dsu end

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN (pathCompress dsu 1 c (ancestor dsu (length dsu) c)) (length dsu)

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN match nth c dsu (Ancestor Unit) with | ReferTo _ => <[c:=ReferTo (ancestor dsu (length dsu) c)]> dsu | Ancestor _ => dsu end (length dsu)

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu)

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu)
stepD: ancestor dsu (length dsu) c = ancestor dsu (length dsu) x

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu)
stepD: ancestor dsu (length dsu) a = ancestor dsu (length dsu) x

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat
IH: _0 : list Slot, noIllegalIndices _0 → withoutCyclesN _0 (length _0) → a < length _0 → b < length _0 → _1 : nat, _1 < length _0 → ancestor _0 (length _0) _1 = ancestor _0 (length _0) a → ancestor (pathCompress _0 n _1 (ancestor _0 (length _0) a)) (length _0) b = ancestor _0 (length _0) b
dsu: list Slot
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
hA: a < length dsu
hB: b < length dsu
c: nat
hC: c < length dsu
hSameRoot: ancestor dsu (length dsu) c = ancestor dsu (length dsu) a
x: nat
hx: nth c dsu (Ancestor Unit) = ReferTo x
stepC: match nth c dsu (Ancestor Unit) with | ReferTo _ => true | Ancestor _ => false end
stepX: x < length dsu
step: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) → withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu) → a < length dsu → b < length dsu → x < length dsu → ancestor dsu (length dsu) x = ancestor dsu (length dsu) a → ancestor (pathCompress (<[c:= ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
stepN: noIllegalIndices (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
stepW: withoutCyclesN (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) (length dsu)
stepD: ancestor dsu (length dsu) x = ancestor dsu (length dsu) a

ancestor (pathCompress (<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu) n x (ancestor dsu (length dsu) a)) (length dsu) b = ancestor dsu (length dsu) b
apply step; assumption. Qed. Definition modelScore (interactions : list (Z * Z)) := dsuScore (dsuFromInteractions (repeat (Ancestor Unit) 100) (map (fun (x : Z * Z) => let (a, b) := x in (Z.to_nat a, Z.to_nat b)) interactions)). Definition getBalanceInvoke (state : BlockchainState) (communication : list Z) := match invokeContract (repeat 1%Z 20) (repeat 0%Z 20) 0 state state communication 1 with | Some (a, b) => getBalance (b (repeat 1%Z 20)) | None => 0%Z end.
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: n ≤ 100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) l ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: n ≤ 100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) l ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop 0 (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l ++ repeat 255%Z 0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop (S n) (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop 0 (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l ++ repeat 255%Z 0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l ++ repeat 255%Z 0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l ++ repeat 255%Z 0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l ++ [] | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - 0) l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take 100 l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: 0100
l: list Z
hL: length l = 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
reflexivity.
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop (S n) (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat n - 1)%Z >>= λ _0 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _1 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _0 _1))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _0 _1)) (λ _2 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _0 _1)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _0 _1))) _2)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt ... 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (...)) (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)) (λ ..., Done ... withLocalVariablesReturnValue ... _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat n - 1)%Z >>= λ _0 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _1 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _0 _1))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _0 _1)) (λ _2 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _0 _1)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _0 _1))) _2)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (...)) (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)) (λ ..., Done ... withLocalVariablesReturnValue ... _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) _0)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (...)) (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)) (λ ..., Done ... withLocalVariablesReturnValue ... _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (...)) (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)) (λ ..., Done ... withLocalVariablesReturnValue ... _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

(λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0) = λ _0 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))
h1: (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0) = λ _0 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

(λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0) = λ _0 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

_0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0 = Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))
x: withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))

Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) x = Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) x
reflexivity.
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))
h1: (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0) = λ _0 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))
h1: (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0) = λ _0 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _0

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: _0 : withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) → Action (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (), dropWithinLoop (Dispatch (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z))) (λ _1 : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue (withinLoopReturnValue (DoWithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)))) _1) >>= _0) = Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (_0 _1))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _ : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _ : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
well: _0 : LoopOutcome → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _ : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= _0) = Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z) (λ _ : withArraysReturnValue (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (_0 KeepGoing))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _ : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 ... varsfuncdef_0__main ...)) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 ... arraydef_0__dsu _2 _3)) (λ _4 : ..., Done (...) withLocalVariablesReturnValue (...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue () () end >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
well: _0 : LoopOutcome → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue LoopOutcome (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)) (λ _ : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z)), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= _0) = Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z) (λ _ : withArraysReturnValue (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (_0 KeepGoing))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z) (λ _ : withArraysReturnValue (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands))) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z) (λ _ : withArraysReturnValue (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu (100 - Z.of_nat n - 1) 255%Z), eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands))) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
IH: n ≤ 100 _0 : list Z, length _0 = 100 → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => _0 | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _1 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _1 - 1)%Z >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _3 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _2 _3)) (λ _4 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _4)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => take (100 - n) _0 ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) = λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hh: (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) = λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end
(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) = λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

_0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end = match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
x: arrayIndex0

match x as _0 return (list (arrayType arrayIndex0 environment0 _0)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end = match decide (x = arraydef_0__dsu) with | left _0 => eq_rect_r (λ _1 : arrayIndex0, list (arrayType arrayIndex0 environment0 _1)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _0 | right _ => match x as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end
destruct x; simpl; easy.
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hh: (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) = λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hh: (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) = λ _0 : arrayIndex0, match decide (_0 = arraydef_0__dsu) with | left _1 => eq_rect_r (λ _2 : arrayIndex0, list (arrayType arrayIndex0 environment0 _2)) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) _1 | right _ => match _0 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end end

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (coerceInt (coerceInt (- (1)) 64) 8) >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (...) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue ..., Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue ...) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (Z.to_nat (100 - Z.of_nat n - 1)) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (take (Z.to_nat (100 - Z.of_nat n - 1)) l ++ 255%Z :: drop (S (Z.to_nat (100 - Z.of_nat n - 1))) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (take (100 - S n) l ++ 255%Z :: drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (length (take (100 - S n) l ++ [255%Z])) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (length (take (100 - S n) l) + length [255%Z]) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (length (take (100 - S n) l) + 1) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take ((100 - S n) `min` length l + 1) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (100 - S n + 1) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
step: take (100 - n) ((take (100 - S n) l ++ [255%Z]) ++ drop (S (100 - S n)) l) = take (100 - S n) l ++ [255%Z]

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => (take (100 - S n) l ++ [255%Z]) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => (take (100 - S n) l ++ [255%Z]) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ 255%Z :: repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)

(if decide (Nat.lt (100 - S n) (length l)) then invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands) else Some ([], state)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hIf: ¬ Nat.lt (100 - S n) (length l)

Some ([], state) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hIf: ¬ Nat.lt (100 - S n) (length l)
step: length l ≤ 100 - S n

Some ([], state) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hIf: ¬ Nat.lt (100 - S n) (length l)
step: length l ≤ 99 - n

Some ([], state) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
a, b: Z
n: nat
nextCommands: Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue ()
h: S n ≤ 100
l: list Z
hL: length l = 100
previous: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => <[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) (loop n (λ _0 : nat, dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z (100 - Z.of_nat _0 - 1)%Z >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue Z 255%Z >>= λ _2 : Z, Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main (Store arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu _1 _2)) (λ _3 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (...) varsfuncdef_0__main (...))) _3)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__main) withinLoopReturnValue () ())) >>= λ _ : (), nextCommands)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - n) (<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l) ++ repeat 255%Z n | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
hIf: ¬ Nat.lt (100 - S n) (length l)
step: 10099 - n

Some ([], state) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state state [ a; b] 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => take (100 - S n) l ++ repeat 255%Z (S n) | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [0%Z] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20) nextCommands)
lia. Qed.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2, a: Z
hLe1: (0 ≤ a)%Z
hLt1: (a < 100)%Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: n ≤ 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2, a: Z
hLe1: (0 ≤ a)%Z
hLt1: (a < 100)%Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: n ≤ 100

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: n ≤ 100

_0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., Done ... withLocalVariablesReturnValue bool ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (...) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
hN: 0100
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop 0 (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu 0 (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop (S n) (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
hN: 0100
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop 0 (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu 0 (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
rewrite (ltac:(simpl; reflexivity) : loop 0 _ = _), (ltac:(simpl; reflexivity) : ancestor dsu 0 _ = _), Z2Nat.id, leftIdentity; [reflexivity | lia].
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop (S n) (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _2 8 < toSigned _3 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (...) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ ..., ... >>= ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (...) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (...) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ ..., ... >>= ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (...) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) _0) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _2 8 < toSigned _3 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= (λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (...) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ ..., ... >>= ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (...) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (...) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ ..., ... >>= ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (...) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) _0) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _2 8 < toSigned _3 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (...), Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: (_0 : varsfuncdef_0__ancestor) (_1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0) (λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0)) _2) >>= _1) = eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_1 ((λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) _0))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) _0) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _2 8 < toSigned _3 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (...), Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: (_0 : varsfuncdef_0__ancestor) (_1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0) (λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor _0)) _2) >>= _1) = eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_1 ((λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) _0))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt a 64) >>= λ _0 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _0 >>= λ _1 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _1 8 < toSigned _2 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt a 64) >>= λ _0 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _0 >>= λ _1 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _1 8 < toSigned _2 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

coerceInt a 64 = a
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt a 64) >>= λ _0 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _0 >>= λ _1 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _1 8 < toSigned _2 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z

coerceInt a 64 = a
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z

(0 ≤ a)%Z → (a < 100)%Z → coerceInt a 64 = a
a: Z

(0 ≤ a)%Z → (a < 100)%Z → coerceInt a 64 = a
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z

coerceInt a 64 = a
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z

(a `mod` 2 ^ 64)%Z = a
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z

a = a
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z
(0 ≤ a < 2 ^ 64)%Z
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z

a = a
reflexivity.
a: Z
h1: (0 ≤ a)%Z
h2: (a < 100)%Z

(0 ≤ a < 2 ^ 64)%Z
lia.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt a 64) >>= λ _0 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _0 >>= λ _1 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _2 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _1 8 < toSigned _2 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu a >>= (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) _0) >>= (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
step2: _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) _1) >>= _0) = Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _1 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_0 _1))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) _0) >>= (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
step2: _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) (λ _1 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) _1) >>= _0) = Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _1 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _2 : varsfuncdef_0__ancestor, match _2 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_0 _1))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _0 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 ... varsfuncdef_0__ancestor >>= ..., ... else Done (...) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (... >>= ...) >>= λ _ : (), Done (...) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation)) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _0 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 ... varsfuncdef_0__ancestor >>= ..., ... else Done (...) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (... >>= ...) >>= λ _ : (), Done (...) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation)) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _0 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned _0 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 ... varsfuncdef_0__ancestor >>= ..., ... else Done (...) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (... >>= ...) >>= λ _ : (), Done (...) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a

match decide (Nat.lt (Z.to_nat a) (length (convertToArray dsu))) with | left _0 => invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _1 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (nth_lt (convertToArray dsu) (Z.to_nat a) _0) 8 < toSigned _1 8)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= λ _4 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _4) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (...), Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) | right _ => Some ([], state1) end = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _0 : Z, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (nth_lt (convertToArray dsu) (Z.to_nat a) hs) 8 < toSigned _0 8)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (nth_lt (convertToArray dsu) (Z.to_nat a) hs) 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned match nth (Z.to_nat a) dsu (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => 256 - Z.of_nat (leafCount _0) end 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
g: Slot
hg: g = nth (Z.to_nat a) dsu (Ancestor Unit)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned match g with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => 256 - Z.of_nat (leafCount _0) end 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
g: Slot
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned match g with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => 256 - Z.of_nat (leafCount _0) end 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (Z.of_nat g) 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (Z.of_nat g) 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ((if decide (Z.of_nat g < 2 ^ (8 - 1)) then Z.of_nat g else Z.of_nat g - 2 ^ 8) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ((if decide (Z.of_nat g < 2 ^ (8 - 1)) then Z.of_nat g else Z.of_nat g - 2 ^ 8) < 0)%Z
_0: g < length dsu

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
_1: (Z.of_nat g < 2 ^ (8 - 1))%Z
hs: (Z.of_nat g < 0)%Z
_0: g < length dsu

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
lia.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _2) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _2) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work)) _0) >>= (λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _2) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu a >>= (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)) (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a))) _0) >>= (λ _0 : withLocalVariablesReturnValue (DoWithArrays arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a)), dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _0 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 ... varsfuncdef_0__ancestor >>= ..., ... else Done (...) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : ..., liftToWithinLoop ... >>= ..., ...)) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation)) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (Dispatch (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue () (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a) (λ _0 : withArraysReturnValue (Retrieve arrayIndex0 (arrayType arrayIndex0 environment0) arraydef_0__dsu a), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _0) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue ..., Done (...) withLocalVariablesReturnValue Z (...) >>= λ ..., ... >>= ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 ... varsfuncdef_0__ancestor >>= ..., ... else Done (...) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : ..., liftToWithinLoop ... >>= ..., ...)) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2)) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: ¬ (toSigned (Z.of_nat g) 8 < 0)%Z

match decide (Nat.lt (Z.to_nat a) (length (convertToArray dsu))) with | left _0 => invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) _0)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (...), Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : withLocalVariablesReturnValue ..., liftToWithinLoop (...) >>= λ ..., Done ... withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) | right _ => Some ([], state1) end = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g

match decide (Nat.lt (Z.to_nat a) (length (convertToArray dsu))) with | left _0 => invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) _0)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _1 : LoopOutcome, match _1 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : withLocalVariablesReturnValue (...), Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : withLocalVariablesReturnValue ..., liftToWithinLoop (...) >>= λ ..., Done ... withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) | right _ => Some ([], state1) end = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs) >>= λ _ : (), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= ..., ...) >>= λ _2 : bool, (if _2 then ... >>= ... else Done ... withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (...) >>= λ ..., ... >>= ...)) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _0 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) _0) >>= λ _ : (), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= ..., ...) >>= λ _2 : bool, (if _2 then ... >>= ... else Done ... withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (...) >>= λ ..., ... >>= ...)) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: _0 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _1 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) _1) >>= _0) = eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_0 ())

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _0 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) _0) >>= λ _ : (), dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= ..., ...) >>= λ _2 : bool, (if _2 then ... >>= ... else Done ... withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (...) >>= λ ..., ... >>= ...)) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: _0 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (), eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Dispatch (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _1 : withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue (withLocalVariablesReturnValue (NumberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs))) _1) >>= _0) = eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (_0 ())

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : withLocalVariablesReturnValue ..., liftToWithinLoop (...) >>= λ ..., Done ... withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _2 : bool, (if _2 then break arrayIndex0 (...) varsfuncdef_0__ancestor >>= λ ..., Done ... withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _3 : withLocalVariablesReturnValue ..., liftToWithinLoop (...) >>= λ ..., Done ... withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

nth_lt (convertToArray dsu) (Z.to_nat a) hs = Z.of_nat g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: nth_lt (convertToArray dsu) (Z.to_nat a) hs = Z.of_nat g
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

nth_lt (convertToArray dsu) (Z.to_nat a) hs = Z.of_nat g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

match nth (Z.to_nat a) dsu (Ancestor Unit) with | ReferTo _0 => Z.of_nat _0 | Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z end = Z.of_nat g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

Z.of_nat g = Z.of_nat g
reflexivity.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: nth_lt (convertToArray dsu) (Z.to_nat a) hs = Z.of_nat g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (nth_lt (convertToArray dsu) (Z.to_nat a) hs)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: nth_lt (convertToArray dsu) (Z.to_nat a) hs = Z.of_nat g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

(λ _0 : varsfuncdef_0__ancestor, if decide (_0 = vardef_0__ancestor_work) then Z.of_nat g else match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

_0 : varsfuncdef_0__ancestor, (if decide (_0 = vardef_0__ancestor_work) then Z.of_nat g else match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) = match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
aa: varsfuncdef_0__ancestor

(if decide (aa = vardef_0__ancestor_work) then Z.of_nat g else match aa with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) = match aa with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end
destruct aa; easy.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g)) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: update (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) vardef_0__ancestor_work (Z.of_nat g) = λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., numberLocalSet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat (Z.of_nat g))) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat (Z.of_nat g))) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat g end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _0 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _0 64) >>= λ _1 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _1 >>= λ _2 : arrayType arrayIndex0 environment0 arraydef_0__dsu, Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt 0 8) >>= λ _3 : Z, Done (WithLocalVariables arrayIndex0 (...) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (...)%Z)) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 ... varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _2 64) >>= λ _3 : Z, retrieve arrayIndex0 ... varsfuncdef_0__ancestor arraydef_0__dsu _3 >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat (Z.of_nat g))) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

ancestor dsu (S n) (Z.to_nat a) = ancestor dsu n g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: ancestor dsu (S n) (Z.to_nat a) = ancestor dsu n g
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

ancestor dsu (S n) (Z.to_nat a) = ancestor dsu n g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

match nth (Z.to_nat a) dsu (Ancestor Unit) with | ReferTo _0 => ancestor dsu n _0 | Ancestor _ => Z.to_nat a end = ancestor dsu n g
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))

ancestor dsu n g = ancestor dsu n g
reflexivity.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: ancestor dsu (S n) (Z.to_nat a) = ancestor dsu n g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: nat
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = ReferTo g
hs: Nat.lt (Z.to_nat a) (length (convertToArray dsu))
step3: ancestor dsu (S n) (Z.to_nat a) = ancestor dsu n g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n g) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
reflexivity.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool (bool_decide (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z)) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: ¬ (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool true >>= (λ _0 : bool, dropWithinLoop ((if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work) >>= λ _2 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 ... varsfuncdef_0__ancestor vardef_0__ancestor_work), liftToWithinLoop (Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

ancestor dsu (S n) (Z.to_nat a) = Z.to_nat a
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z
step3: ancestor dsu (S n) (Z.to_nat a) = Z.to_nat a
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

ancestor dsu (S n) (Z.to_nat a) = Z.to_nat a
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

match nth (Z.to_nat a) dsu (Ancestor Unit) with | ReferTo _0 => ancestor dsu n _0 | Ancestor _ => Z.to_nat a end = Z.to_nat a
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

Z.to_nat a = Z.to_nat a
reflexivity.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z
step3: ancestor dsu (S n) (Z.to_nat a) = Z.to_nat a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z
step3: ancestor dsu (S n) (Z.to_nat a) = Z.to_nat a

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
reflexivity.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: ¬ (toSigned (256 - Z.of_nat (leafCount g)) 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hs: ¬ ((if decide (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1)) then 256 - Z.of_nat (leafCount g) else 256 - Z.of_nat (leafCount g) - 2 ^ 8) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: ¬ (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) - 2 ^ 8 < 0)%Z
invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: (256 - Z.of_nat (leafCount g) < 128)%Z
hs: ¬ (256 - Z.of_nat (leafCount g) < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: (256 - Z.of_nat (leafCount g) < 128)%Z
hs: ¬ (256 - Z.of_nat (leafCount g) < 0)%Z
_0: leafCount g < 128

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
lia.
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: ¬ (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) - 2 ^ 8 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: ¬ (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) - 256 < 0)%Z

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
dsu: list Slot
state1, state2: BlockchainState
hL: length dsu = 100
hM: Z.to_nat (dsuLeafCount dsu) = length dsu
h1: noIllegalIndices dsu
h2: withoutCyclesN dsu (length dsu)
whatever2: Z
communication: list Z
continuation: () → Action (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue ()
continuation2: () → Action (WithArrays arrayIndex0 (arrayType arrayIndex0 environment0)) withArraysReturnValue ()
whatever: arrayType arrayIndex0 environment0 arraydef_0__result
n: nat
hN: S n ≤ 100
IH: n ≤ 100 _0 : Z, (_0 < 100)%Z → (0 ≤ _0)%Z → invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => _0 end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _1 : arrayIndex0, match _1 as _2 return (list (arrayType arrayIndex0 environment0 _2)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _1 : varsfuncdef_0__ancestor, match _1 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu n (Z.to_nat _0)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
a: Z
hLt1: (a < 100)%Z
hLe1: (0 ≤ a)%Z
step: coerceInt a 64 = a
g: Tree
hg: nth (Z.to_nat a) dsu (Ancestor Unit) = Ancestor g
hss: ¬ (256 - Z.of_nat (leafCount g) < 2 ^ (8 - 1))%Z
hs: ¬ (256 - Z.of_nat (leafCount g) - 256 < 0)%Z
_0: 1 ≤ leafCount g

invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => a end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (dropWithinLoop (liftToWithinLoop (Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue bool false) >>= λ _0 : bool, (if _0 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : arrayType arrayIndex0 environment0 arraydef_0__dsu, numberLocalSet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work _3) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _0 : LoopOutcome, match _0 with | KeepGoing => loop n (λ _ : nat, dropWithinLoop (liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _1 : withLocalVariablesReturnValue (NumberLocalGet arrayIndex0 (...) varsfuncdef_0__ancestor vardef_0__ancestor_work), Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue Z (coerceInt _1 64) >>= λ _2 : Z, retrieve arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor arraydef_0__dsu _2 >>= λ _3 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _1 : bool, (if _1 then break arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor >>= λ _ : (), Done (WithinLoop arrayIndex0 ... varsfuncdef_0__ancestor) withinLoopReturnValue () () else Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ()) >>= λ _ : (), liftToWithinLoop (numberLocalGet arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor vardef_0__ancestor_work >>= λ _2 : ..., Done ... withLocalVariablesReturnValue Z ... >>= ..., ...) >>= λ _ : (), Done (WithinLoop arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withinLoopReturnValue () ())) | Stop => Done (WithLocalVariables arrayIndex0 (arrayType arrayIndex0 environment0) varsfuncdef_0__ancestor) withLocalVariablesReturnValue () () end >>= continuation) >>= continuation2) = invokeContractAux (repeat 1%Z 20) (repeat 0%Z 20) 0 state1 state2 communication 1 arrayIndex0 arrayIndexEqualityDecidable0 (arrayType arrayIndex0 environment0) (λ _0 : arrayIndex0, match _0 as _1 return (list (arrayType arrayIndex0 environment0 _1)) with | arraydef_0__dsu => convertToArray dsu | arraydef_0__hasBeenInitialized => [1%Z] | arraydef_0__result => [whatever] end) (funcdef_0__main (λ _ : varsfuncdef_0__main, false) (λ _ : varsfuncdef_0__main, 0%Z) (λ _ : varsfuncdef_0__main, repeat 0%Z 20)) (eliminateLocalVariables (λ _ : varsfuncdef_0__ancestor, false) (λ _0 : varsfuncdef_0__ancestor, match _0 with | vardef_0__ancestor_vertex => whatever2 | vardef_0__ancestor_work => Z.of_nat (ancestor dsu (S n) (Z.to_nat a)) end) (λ _ : varsfuncdef_0__ancestor, repeat 0%Z 20) (continuation ()) >>= continuation2)
lia. Qed. Fixpoint roll (dsu : list Slot) : option Tree := match dsu with | [] => None | Ancestor x :: rest => match roll rest with | None => Some x | Some y => Some (Unite x y) end | ReferTo x :: rest => roll rest end.
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ score (default Unit (roll dsu))
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ score (default Unit (roll dsu))

Z.to_nat (dsuScore []) ≤ score (default Unit (roll []))
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))
Z.to_nat (dsuScore (head :: tail)) ≤ score (default Unit (roll (head :: tail)))

Z.to_nat (dsuScore []) ≤ score (default Unit (roll []))
easy.
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

Z.to_nat (dsuScore (head :: tail)) ≤ score (default Unit (roll (head :: tail)))
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (head :: tail)))) ≤ score (default Unit (roll (head :: tail)))
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (head :: tail)) ≤ score (default Unit (roll (head :: tail)))
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) ([head] ++ tail)) ≤ score (default Unit (roll (head :: tail)))
head: Slot
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [head]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll (head :: tail)))
x: nat
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll (ReferTo x :: tail)))
x: Tree
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))
list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll (Ancestor x :: tail)))
x: nat
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll (ReferTo x :: tail)))
x: nat
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll tail))
x: nat
tail: list Slot
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail))) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll tail))
x: nat
tail: list Slot
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll tail))
exact IH.
x: Tree
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (roll (Ancestor x :: tail)))
x: Tree
tail: list Slot
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (roll tail))

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit match roll tail with | Some _0 => Some (Unite x _0) | None => Some x end)
x: Tree
tail: list Slot
g: option Tree
hg: g = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit g)

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit match g with | Some _0 => Some (Unite x _0) | None => Some x end)
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (Some g))

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (Some (Unite x g)))
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit None)
score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (Some x))
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit (Some g))

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (Some (Unite x g)))
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score g

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ leafCount x + leafCount g + score x + score g
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail))) ≤ score g

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ leafCount x + leafCount g + score x + score g
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score g

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ leafCount x + leafCount g + score x + score g
lia.
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit None)

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (Some x))
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuScore tail) ≤ score (default Unit None)

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score (default Unit (Some x))
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuScore tail) ≤ 0

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score x
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail))) ≤ 0

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score x
x: Tree
tail: list Slot
hg: None = roll tail
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ 0

score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail) ≤ score x
lia. } Qed.
dsu: list Slot

Z.to_nat (dsuLeafCount dsu) = match roll dsu with | Some _0 => leafCount _0 | None => 0 end
dsu: list Slot

Z.to_nat (dsuLeafCount dsu) = match roll dsu with | Some _0 => leafCount _0 | None => 0 end

Z.to_nat (dsuLeafCount []) = match roll [] with | Some _0 => leafCount _0 | None => 0 end
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
Z.to_nat (dsuLeafCount (head :: tail)) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end

Z.to_nat (dsuLeafCount []) = match roll [] with | Some _0 => leafCount _0 | None => 0 end
easy.
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

Z.to_nat (dsuLeafCount (head :: tail)) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (head :: tail)))) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (head :: tail)) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ([head] ++ tail)) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end
head: Slot
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [head]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll (head :: tail) with | Some _0 => leafCount _0 | None => 0 end
x: nat
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
x: Tree
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match match roll tail with | Some _0 => Some (Unite x _0) | None => Some x end with | Some _0 => leafCount _0 | None => 0 end
x: nat
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
x: nat
tail: list Slot
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail))) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
x: nat
tail: list Slot
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end
exact IH.
x: Tree
tail: list Slot
IH: Z.to_nat (dsuLeafCount tail) = match roll tail with | Some _0 => leafCount _0 | None => 0 end

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match match roll tail with | Some _0 => Some (Unite x _0) | None => Some x end with | Some _0 => leafCount _0 | None => 0 end
x: Tree
tail: list Slot
g: option Tree
hg: g = roll tail
IH: Z.to_nat (dsuLeafCount tail) = match g with | Some _0 => leafCount _0 | None => 0 end

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = match match g with | Some _0 => Some (Unite x _0) | None => Some x end with | Some _0 => leafCount _0 | None => 0 end
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuLeafCount tail) = leafCount g

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount (Unite x g)
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuLeafCount tail) = 0
leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuLeafCount tail) = leafCount g

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount (Unite x g)
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (dsuLeafCount tail) = leafCount g

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x + leafCount g
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail))) = leafCount g

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x + leafCount g
x: Tree
tail: list Slot
g: Tree
hg: Some g = roll tail
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount g

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x + leafCount g
lia.
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuLeafCount tail) = 0

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuLeafCount tail) = 0

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (dsuLeafCount tail) = 0

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
x: Tree
tail: list Slot
hg: None = roll tail
IH: Z.to_nat (Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail))) = 0

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
x: Tree
tail: list Slot
hg: None = roll tail
IH: list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = 0

leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail) = leafCount x
lia. } Qed.
dsu: list Slot
h: roll dsu = None

dsuScore dsu = 0%Z
dsu: list Slot
h: roll dsu = None

dsuScore dsu = 0%Z
h: roll [] = None

dsuScore [] = 0%Z
head: Slot
tail: list Slot
h: roll (head :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (head :: tail) = 0%Z
h: roll [] = None

dsuScore [] = 0%Z
easy.
head: Slot
tail: list Slot
h: roll (head :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (head :: tail) = 0%Z
g: nat
tail: list Slot
h: roll (ReferTo g :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (ReferTo g :: tail) = 0%Z
_0: Tree
tail: list Slot
h: roll (Ancestor _0 :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (Ancestor _0 :: tail) = 0%Z
g: nat
tail: list Slot
h: roll (ReferTo g :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (ReferTo g :: tail) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (ReferTo g :: tail) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (ReferTo g :: tail))) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) ([ReferTo g] ++ tail))) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo g]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
exact (IH h).
_0: Tree
tail: list Slot
h: roll (Ancestor _0 :: tail) = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (Ancestor _0 :: tail) = 0%Z
_0: Tree
tail: list Slot
h: match roll tail with | Some _1 => Some (Unite _0 _1) | None => Some _0 end = None
IH: roll tail = None → dsuScore tail = 0%Z

dsuScore (Ancestor _0 :: tail) = 0%Z
destruct (roll tail); easy. Qed.
dsu: list Slot
h: roll dsu = None

dsuLeafCount dsu = 0%Z
dsu: list Slot
h: roll dsu = None

dsuLeafCount dsu = 0%Z
h: roll [] = None

dsuLeafCount [] = 0%Z
head: Slot
tail: list Slot
h: roll (head :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (head :: tail) = 0%Z
h: roll [] = None

dsuLeafCount [] = 0%Z
easy.
head: Slot
tail: list Slot
h: roll (head :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (head :: tail) = 0%Z
g: nat
tail: list Slot
h: roll (ReferTo g :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (ReferTo g :: tail) = 0%Z
_0: Tree
tail: list Slot
h: roll (Ancestor _0 :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (Ancestor _0 :: tail) = 0%Z
g: nat
tail: list Slot
h: roll (ReferTo g :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (ReferTo g :: tail) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (ReferTo g :: tail) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (ReferTo g :: tail))) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ([ReferTo g] ++ tail))) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo g]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
g: nat
tail: list Slot
h: roll tail = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
exact (IH h).
_0: Tree
tail: list Slot
h: roll (Ancestor _0 :: tail) = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (Ancestor _0 :: tail) = 0%Z
_0: Tree
tail: list Slot
h: match roll tail with | Some _1 => Some (Unite _0 _1) | None => Some _0 end = None
IH: roll tail = None → dsuLeafCount tail = 0%Z

dsuLeafCount (Ancestor _0 :: tail) = 0%Z
destruct (roll tail); easy. Qed.
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot
g: option Tree
hg: g = roll dsu

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score (default Unit (roll dsu))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score (default Unit (roll dsu))
a2: leafCount (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = leafCount (default Unit (roll dsu)) → score (default Unit (roll dsu)) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score (default Unit (roll dsu))
a2: leafCount (constructTree (match roll dsu with | Some _0 => leafCount _0 | None => 0 end - 1)) = leafCount (default Unit (roll dsu)) → score (default Unit (roll dsu)) ≤ score (constructTree (match roll dsu with | Some _0 => leafCount _0 | None => 0 end - 1))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (match roll dsu with | Some _0 => leafCount _0 | None => 0 end - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score (default Unit (Some g))
a2: leafCount (constructTree (leafCount g - 1)) = leafCount (default Unit (Some g)) → score (default Unit (Some g)) ≤ score (constructTree (leafCount g - 1))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (leafCount g - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score g
a2: leafCount (constructTree (leafCount g - 1)) = leafCount g → score g ≤ score (constructTree (leafCount g - 1))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (leafCount g - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score g
a2: leafCount (constructTree (leafCount g - 1)) = leafCount g → score g ≤ score (constructTree (leafCount g - 1))
_0: 1 ≤ leafCount g

Z.to_nat (dsuScore dsu) ≤ score (constructTree (leafCount g - 1))
dsu: list Slot
g: Tree
hg: roll dsu = Some g
a1: Z.to_nat (dsuScore dsu) ≤ score g
a2: leafCount (constructTree (leafCount g - 1)) = leafCount g → score g ≤ score (constructTree (leafCount g - 1))
_0: 1 ≤ leafCount g
_1: score g ≤ score (constructTree (leafCount g - 1))

Z.to_nat (dsuScore dsu) ≤ score (constructTree (leafCount g - 1))
lia. Qed.
dsu: list Slot
h: dsuLeafCount dsu = 0%Z

dsuScore dsu = 0%Z
dsu: list Slot
h: dsuLeafCount dsu = 0%Z

dsuScore dsu = 0%Z
h: dsuLeafCount [] = 0%Z

dsuScore [] = 0%Z
head: Slot
tail: list Slot
h: dsuLeafCount (head :: tail) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z
dsuScore (head :: tail) = 0%Z
h: dsuLeafCount [] = 0%Z

dsuScore [] = 0%Z
easy.
head: Slot
tail: list Slot
h: dsuLeafCount (head :: tail) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

dsuScore (head :: tail) = 0%Z
head: Slot
tail: list Slot
h: dsuLeafCount (head :: tail) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (head :: tail))) = 0%Z
head: Slot
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (head :: tail))) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) (head :: tail))) = 0%Z
head: Slot
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [head]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [head]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: nat
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: Tree
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z
Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: nat
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: nat
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
exact (IH h).
x: Tree
tail: list Slot
h: Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) [Ancestor x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: Tree
tail: list Slot
h: Z.of_nat (leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z

Z.of_nat (score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
x: Tree
tail: list Slot
h: Z.of_nat (leafCount x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) tail)) = 0%Z
IH: dsuLeafCount tail = 0%Z → dsuScore tail = 0%Z
_0: 1 ≤ leafCount x

Z.of_nat (score x + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => score _1 end) tail)) = 0%Z
lia. Qed.
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1

dsuLeafCount dsu = 0%Z ∨ (0 < dsuLeafCount dsu)%Z
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: dsuLeafCount dsu = 0%Z ∨ (0 < dsuLeafCount dsu)%Z
Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1

dsuLeafCount dsu = 0%Z ∨ (0 < dsuLeafCount dsu)%Z
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) dsu)) = 0%Z ∨ (0 < Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0%nat | Ancestor _1 => leafCount _1 end) dsu)))%Z
lia.
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: dsuLeafCount dsu = 0%Z ∨ (0 < dsuLeafCount dsu)%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: dsuLeafCount dsu = 0%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: (0 < dsuLeafCount dsu)%Z
Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: dsuLeafCount dsu = 0%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: dsuLeafCount dsu = 0%Z
hI: dsuScore dsu = 0%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
lia.
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = ((Z.to_nat (dsuLeafCount dsu) - 1 + 1) * (Z.to_nat (dsuLeafCount dsu) - 1 + 2)) `div` 2 - 1
hS: (0 < dsuLeafCount dsu)%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
dsu: list Slot
h1: Z.to_nat (dsuScore dsu) ≤ score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1))
h2: score (constructTree (Z.to_nat (dsuLeafCount dsu) - 1)) = (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
hS: (0 < dsuLeafCount dsu)%Z

Z.to_nat (dsuScore dsu) ≤ (Z.to_nat (dsuLeafCount dsu) * (Z.to_nat (dsuLeafCount dsu) + 1)) `div` 2 - 1
lia. Qed.
dsu: list Slot
a, b: nat

length (unite dsu a b) = length dsu
dsu: list Slot
a, b: nat

length (unite dsu a b) = length dsu
dsu: list Slot
a, b: nat

length (if decide (length dsu ≤ a) then dsu else if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = length dsu
dsu: list Slot
a, b: nat
h1: length dsu ≤ a

length dsu = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
length (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = length dsu
dsu: list Slot
a, b: nat
h1: length dsu ≤ a

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a

length (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

length dsu = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
length (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

length (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
length match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

length match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
length match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree

length match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
n: nat

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
length (if decide (leafCount n < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
n: nat

length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
n: nat

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree

length (if decide (leafCount n < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: leafCount n < leafCount m

length (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: ¬ leafCount n < leafCount m
length (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: leafCount n < leafCount m

length (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: leafCount n < leafCount m

length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: leafCount n < leafCount m

length dsu = length dsu
reflexivity.
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: ¬ leafCount n < leafCount m

length (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: ¬ leafCount n < leafCount m

length (<[ancestor dsu (length dsu) a:=ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) = length dsu
dsu: list Slot
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m, n: Tree
h4: ¬ leafCount n < leafCount m

length dsu = length dsu
reflexivity. Qed.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat

dsuLeafCount (unite dsu a b) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat

dsuLeafCount (unite dsu a b) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat

dsuLeafCount (if decide (length dsu ≤ a) then dsu else if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (...) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: length dsu ≤ a

dsuLeafCount dsu = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
dsuLeafCount (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: length dsu ≤ a

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a

dsuLeafCount (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

dsuLeafCount dsu = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
dsuLeafCount (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

dsuLeafCount (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
dsuLeafCount match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

dsuLeafCount match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ya: Slot
yb: ya = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount match ya with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat
yb: ReferTo m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
dsuLeafCount match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat
yb: ReferTo m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: nat
yb: ReferTo m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
za: Slot
zb: za = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount match za with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: nat
zb: ReferTo n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
dsuLeafCount (if decide (leafCount n < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: nat
zb: ReferTo n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: nat
zb: ReferTo n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

dsuLeafCount (if decide (leafCount n < leafCount m) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

dsuLeafCount (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
dsuLeafCount (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

dsuLeafCount (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) n m (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

dsuLeafCount (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

dsuLeafCount (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:= ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
dsuLeafCount (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:= ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

ancestor dsu (length dsu) a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

noIllegalIndices dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m
a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

noIllegalIndices dsu
exact hN.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m

a < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

dsuLeafCount (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:= ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

y < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

y < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices dsu
assumption.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

a < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

x < length dsu
exact xL. }
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu

b < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y))) = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (take y (<[x:=Ancestor (Unite m n)]> f) ++ ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount ((take x f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - length [Ancestor (Unite m n)]) (drop (S x) f)) ++ ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount ((take x f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsuLeafCount ((take x f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take (S (y - x - 1)) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

Ancestor (Unite m n) :: take (y - x - 1) [] = [Ancestor (Unite m n)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

[Ancestor (Unite m n)] = [Ancestor (Unite m n)]
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

dsuLeafCount ((take x f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

dsuLeafCount ((take x f ++ [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ [ReferTo x] ++ drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

dsuLeafCount ((take x f ++ [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ [ReferTo x] ++ drop (S y) f) = dsuLeafCount (take x f ++ [nth x f (Ancestor Unit)] ++ drop (S x) (take y f) ++ [nth y f (Ancestor Unit)] ++ drop (y + 1) f)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take x f ++ [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ [ReferTo x] ++ drop (S y) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f ++ [nth x f (Ancestor Unit)] ++ drop (S x) (take y f) ++ [nth y f (Ancestor Unit)] ++ drop (y + 1) f)))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor m]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor n]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount (<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount (take y (<[x:=Ancestor (Unite m n)]> f) ++ ReferTo x :: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount ((take y f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - length [Ancestor (Unite m n)]) (drop (S x) f)) ++ ReferTo x :: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount ((take y f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take (y - x) [Ancestor (Unite m n)] = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount ((take y f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take (y - x) [Ancestor (Unite m n)] = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take 0 [Ancestor (Unite m n)] = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

[] = []
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

dsuLeafCount ((take y f ++ take (y - x) [Ancestor (Unite m n)] ++ take (y - x - 1) (drop (S x) f)) ++ ReferTo x :: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

dsuLeafCount ((take y f ++ drop (S x) (take (S x) f)) ++ ReferTo x :: drop (S y) (take x f) ++ Ancestor (Unite m n) :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

dsuLeafCount ((take y f ++ drop (S x) (take (S x) f)) ++ [ReferTo x] ++ drop (S y) (take x f) ++ [Ancestor (Unite m n)] ++ drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

dsuLeafCount ((take y f ++ drop (S x) (take (S x) f)) ++ [ReferTo x] ++ drop (S y) (take x f) ++ [Ancestor (Unite m n)] ++ drop (S x) f) = dsuLeafCount (take y f ++ [nth y f (Ancestor Unit)] ++ drop (S y) (take x f) ++ [nth x f (Ancestor Unit)] ++ drop (x + 1) f)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take y f ++ drop (S x) (take (S x) f)) ++ [ReferTo x] ++ drop (S y) (take x f) ++ [Ancestor (Unite m n)] ++ drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f ++ [nth y f (Ancestor Unit)] ++ drop (S y) (take x f) ++ [nth x f (Ancestor Unit)] ++ drop (x + 1) f)))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo x]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite m n)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor n]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor m]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
ms: drop (S x) (take (S x) f) = []
Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

length (drop (S x) (take (S x) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

length (drop (S x) (take (S x) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []

S x `min` length f - S x = 0
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
mt: length (drop (S x) (take (S x) f)) = 0

drop (S x) (take (S x) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
ms: drop (S x) (take (S x) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take (S x) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
ms: drop (S x) (take (S x) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) []) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (y - x) [Ancestor (Unite m n)] = []
ms: drop (S x) (take (S x) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

dsuLeafCount (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) m n (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
h3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
m: Tree
yb: Ancestor m = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

dsuLeafCount (<[ancestor dsu (length dsu) a:=ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

dsuLeafCount (<[x:=ReferTo (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)]> (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
dsuLeafCount (<[x:=ReferTo (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)]> (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

ancestor dsu (length dsu) a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

noIllegalIndices dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

noIllegalIndices dsu
exact hN.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m

a < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
h3: x ≠ ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b) (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

dsuLeafCount (<[x:=ReferTo (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)]> (<[ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b (ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b)))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

y < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

y < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

noIllegalIndices dsu
assumption.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

a < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

a < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

x < length dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

x < length dsu
exact xL. }
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu

b < length dsu
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu

dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y))) = dsuLeafCount dsu
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
lp: dsuLeafCount dsu = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y))) = dsuLeafCount (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f

length dsu = length dsu
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount (take x (<[y:=Ancestor (Unite n m)]> f) ++ ReferTo y :: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount ((take x f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - length [Ancestor (Unite n m)]) (drop (S y) f)) ++ ReferTo y :: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

dsuLeafCount ((take x f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take (x - y) [Ancestor (Unite n m)] = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount ((take x f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take (x - y) [Ancestor (Unite n m)] = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y

take 0 [Ancestor (Unite n m)] = []
easy.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

dsuLeafCount ((take x f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

dsuLeafCount ((take x f ++ drop (S y) (take (S y) f)) ++ ReferTo y :: drop (S x) (take y f) ++ Ancestor (Unite n m) :: drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

dsuLeafCount ((take x f ++ drop (S y) (take (S y) f)) ++ [ReferTo y] ++ drop (S x) (take y f) ++ [Ancestor (Unite n m)] ++ drop (S y) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

dsuLeafCount ((take x f ++ drop (S y) (take (S y) f)) ++ [ReferTo y] ++ drop (S x) (take y f) ++ [Ancestor (Unite n m)] ++ drop (S y) f) = dsuLeafCount (take x f ++ [nth x f (Ancestor Unit)] ++ drop (S x) (take y f) ++ [nth y f (Ancestor Unit)] ++ drop (y + 1) f)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take x f ++ drop (S y) (take (S y) f)) ++ [ReferTo y] ++ drop (S x) (take y f) ++ [Ancestor (Unite n m)] ++ drop (S y) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f ++ [nth x f (Ancestor Unit)] ++ drop (S x) (take y f) ++ [nth y f (Ancestor Unit)] ++ drop (y + 1) f)))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f)))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor m]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor n]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (y + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

drop (S y) (take (S y) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
ms: drop (S y) (take (S y) f) = []
Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

drop (S y) (take (S y) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

length (drop (S y) (take (S y) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
mt: length (drop (S y) (take (S y) f)) = 0
drop (S y) (take (S y) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

length (drop (S y) (take (S y) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []

S y `min` length f - S y = 0
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
mt: length (drop (S y) (take (S y) f)) = 0

drop (S y) (take (S y) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
ms: drop (S y) (take (S y) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take (S y) f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
ms: drop (S y) (take (S y) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) []) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: x < y
stp: take (x - y) [Ancestor (Unite n m)] = []
ms: drop (S y) (take (S y) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take x f)) + (leafCount m + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) (take y f))) + (leafCount n + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) f))))))
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount (<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount (take x (<[y:=Ancestor (Unite n m)]> f) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount ((take y f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - length [Ancestor (Unite n m)]) (drop (S y) f)) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

dsuLeafCount ((take y f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount ((take y f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

take (S (x - y - 1)) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

Ancestor (Unite n m) :: take (x - y - 1) [] = [Ancestor (Unite n m)]
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x

[Ancestor (Unite n m)] = [Ancestor (Unite n m)]
reflexivity.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

dsuLeafCount ((take y f ++ take (x - y) [Ancestor (Unite n m)] ++ take (x - y - 1) (drop (S y) f)) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

dsuLeafCount ((take y f ++ [Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++ ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

dsuLeafCount ((take y f ++ [Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++ [ReferTo y] ++ drop (S x) f) = dsuLeafCount f
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

dsuLeafCount ((take y f ++ [Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++ [ReferTo y] ++ drop (S x) f) = dsuLeafCount (take y f ++ [nth y f (Ancestor Unit)] ++ drop (S y) (take x f) ++ [nth x f (Ancestor Unit)] ++ drop (x + 1) f)
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) ((take y f ++ [Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++ [ReferTo y] ++ drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f ++ [nth y f (Ancestor Unit)] ++ drop (S y) (take x f) ++ [nth x f (Ancestor Unit)] ++ drop (x + 1) f)))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
yb: Ancestor m = nth x (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y (pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y) (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
f: list Slot
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth y f (Ancestor Unit)]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [nth x f (Ancestor Unit)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor (Unite n m)]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [ReferTo y]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f)))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor n]) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) [Ancestor m]) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (x + 1) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
ms: drop (S x) (take (S x) f) = []
Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

length (drop (S x) (take (S x) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

length (drop (S x) (take (S x) f)) = 0
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]

S x `min` length f - S x = 0
lia.
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
mt: length (drop (S x) (take (S x) f)) = 0

drop (S x) (take (S x) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot
hN: noIllegalIndices dsu
a, b: nat
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
x: nat
hx: x = ancestor dsu (length dsu) a
y: nat
hy: y = ancestor (pathCompress dsu (length dsu) a x) (length (pathCompress dsu (length dsu) a x)) b
h3: x ≠ y
m: Tree
f: list Slot
yb: Ancestor m = nth x f (Ancestor Unit)
n: Tree
zb: Ancestor n = nth y f (Ancestor Unit)
h4: ¬ leafCount n < leafCount m
xL: x < length dsu
yL: y < length dsu
hf: f = pathCompress (pathCompress dsu (length dsu) a x) (length dsu) b y
lp: dsuLeafCount dsu = dsuLeafCount f
cr: length dsu = length f
jj: y < x
stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
ms: drop (S x) (take (S x) f) = []

Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f)))) + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))) = Z.of_nat (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (take y f)) + (leafCount n + 0 + (list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S y) (take x f))) + (leafCount m + 0 + list_sum (map (λ _0 : Slot, match _0 with | ReferTo _ => 0 | Ancestor _1 => leafCount _1 end) (drop (S x) f))))))
lia. Qed.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu

noIllegalIndices (unite dsu a b)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu

noIllegalIndices (unite dsu a b)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu

noIllegalIndices (if decide (length dsu ≤ a) then dsu else if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: length dsu ≤ a

noIllegalIndices dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
noIllegalIndices (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: length dsu ≤ a

noIllegalIndices dsu
exact h.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a

noIllegalIndices (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

noIllegalIndices dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
noIllegalIndices (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: length dsu ≤ b

noIllegalIndices dsu
exact h.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
noIllegalIndices (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
a < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
ancestor dsu (length dsu) a < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

noIllegalIndices dsu
exact h.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

a < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
ancestor dsu (length dsu) a < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

a < length dsu
lia.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

ancestor dsu (length dsu) a < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia). }
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
exact step.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

b < length dsu
lia.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
step: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
exact step. }
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))

noIllegalIndices (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
noIllegalIndices match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
exact gameover.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

noIllegalIndices match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Slot
hA: A = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

noIllegalIndices match A with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Slot
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = A

noIllegalIndices match A with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: nat
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo A

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
noIllegalIndices match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: nat
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo A

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
exact gameover.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A

noIllegalIndices match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Slot
hB: B = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

noIllegalIndices match B with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Slot
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = B

noIllegalIndices match B with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: nat
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo B

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
noIllegalIndices (if decide (leafCount B < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) B A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A B (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: nat
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo B

noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
exact gameover.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B

noIllegalIndices (if decide (leafCount B < leafCount A) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) B A (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) A B (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A

noIllegalIndices (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
noIllegalIndices (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A

noIllegalIndices (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (ReferTo (ancestor dsu (length dsu) a))) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g < length (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (ReferTo (ancestor dsu (length dsu) a))) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor dsu (length dsu) a) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor dsu (length dsu) a) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor dsu (length dsu) a) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

ancestor dsu (length dsu) a = j → j < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor dsu (length dsu) a) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: ancestor dsu (length dsu) a = j

j < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor dsu (length dsu) a) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: ancestor dsu (length dsu) a = j

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

g < length (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; try (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

b < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b g)) !! g) = ReferTo j
hs: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

b < length dsu
lia.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g ≠ ancestor dsu (length dsu) a
j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (Ancestor (Unite A B))) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor dsu (length dsu) a) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a
ancestor dsu (length dsu) a < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (Ancestor (Unite A B))) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
easy.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor dsu (length dsu) a) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

ancestor dsu (length dsu) a < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor dsu (length dsu) a) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g = ancestor dsu (length dsu) a

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g ≠ ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g ≠ ancestor dsu (length dsu) a

j < length (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= ReferTo (ancestor dsu (length dsu) a)]> (<[ancestor dsu (length dsu) a:= Ancestor (Unite A B)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: leafCount B < leafCount A
g, j: nat
i: nth g (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ht: g ≠ ancestor dsu (length dsu) a

j < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
exact (gameover _ _ i).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A

noIllegalIndices (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b))) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b)]> (<[ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b:=Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b))) !! g) = ReferTo j
hs: g = ancestor dsu (length dsu) a
g < length (<[ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b)))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b))) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a

j < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a

ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j → j < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a
ht: ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j

j < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a
ht: ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j

ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b < length (pathCompress dsu (length dsu) a g)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a
ht: ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j

noIllegalIndices (pathCompress dsu (length dsu) a g)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a
ht: ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j

g < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b) = ReferTo j
hs: g = ancestor dsu (length dsu) a
ht: ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b = j

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b)]> (<[ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b:=Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b))) !! g) = ReferTo j
hs: g = ancestor dsu (length dsu) a

g < length (<[ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b)))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[g:=ReferTo (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b)]> (<[ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b:=Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b (ancestor (pathCompress dsu (length dsu) a g) (length (pathCompress dsu (length dsu) a g)) b))) !! g) = ReferTo j
hs: g = ancestor dsu (length dsu) a

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (Ancestor (Unite B A))) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (Some (Ancestor (Unite B A))) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
easy.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
t: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) → _0 _1 : nat, _1 < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) → ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) _0 _1 < length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
t: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) → _0 _1 : nat, _1 < length dsu → ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) _0 _1 < length dsu

ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b < length dsu
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
t: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) → _0 _1 : nat, _1 < length dsu → ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) _0 _1 < length dsu

noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
t: noIllegalIndices (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) → _0 _1 : nat, _1 < length dsu → ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) _0 _1 < length dsu

ancestor dsu (length dsu) a < length dsu
apply ancestorLtLength; (assumption || lia).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: default (Ancestor Unit) (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) !! g) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (<[ancestor dsu (length dsu) a:= ReferTo (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)]> (<[ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b:= Ancestor (Unite B A)]> (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))))
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: ¬ length dsu ≤ a
h2: ¬ length dsu ≤ b
gameover: noIllegalIndices (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
heq: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
A: Tree
hA: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor A
B: Tree
hB: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor B
h3: ¬ leafCount B < leafCount A
g, j: nat
i: nth g (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo j
hs: g ≠ ancestor dsu (length dsu) a
ht: g ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

j < length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b))
exact (gameover _ _ i). Qed.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4

withoutCyclesN (performMerge dsu t1 t2 a b) (length dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4

withoutCyclesN (performMerge dsu t1 t2 a b) (length dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4

withoutCyclesN (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu

noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu

noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr

rr < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr
ww: yy ≠ a
rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth a (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (Some (ReferTo b)) = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) = ReferTo rr
ww: yy = a
a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (Some (ReferTo b)) = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: ReferTo b = ReferTo rr
ww: yy = a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: ReferTo b = ReferTo rr
ww: yy = a

b = rr → rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: ReferTo b = ReferTo rr
ww: yy = a
als: b = rr

rr < length dsu
dsu: list Slot
a: nat
ha: a < length dsu
rr: nat
hh: ReferTo rr = ReferTo rr
hD: a ≠ rr
hb: rr < length dsu
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth rr dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy: nat
ww: yy = a

rr < length dsu
dsu: list Slot
a: nat
ha: a < length dsu
rr: nat
hh: ReferTo rr = ReferTo rr
hD: a ≠ rr
hb: rr < length dsu
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth rr dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy: nat
ww: yy = a
_0: ancestor dsu (length dsu) i < length dsu

rr < length dsu
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) = ReferTo rr
ww: yy = a

a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) = ReferTo rr
ww: yy = a

a < length dsu
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo rr
ww: yy ≠ a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) = ReferTo rr
ww: yy ≠ a

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) = ReferTo rr
ww: yy ≠ a
ii: yy = b

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) = ReferTo rr
ww: yy ≠ a
ii: yy ≠ b
rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) = ReferTo rr
ww: yy ≠ a
ii: yy = b

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! b) = ReferTo rr

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (Some (Ancestor (Unite t2 t1))) = ReferTo rr

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[b:=Ancestor (Unite t2 t1)]> dsu !! b) = ReferTo rr
b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (Some (Ancestor (Unite t2 t1))) = ReferTo rr

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: Ancestor (Unite t2 t1) = ReferTo rr

rr < length dsu
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[b:=Ancestor (Unite t2 t1)]> dsu !! b) = ReferTo rr

b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (Some (Ancestor (Unite t2 t1))) = ReferTo rr

b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[b:=Ancestor (Unite t2 t1)]> dsu !! b) = ReferTo rr
b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (Some (Ancestor (Unite t2 t1))) = ReferTo rr

b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: Ancestor (Unite t2 t1) = ReferTo rr

b < length dsu
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[b:=Ancestor (Unite t2 t1)]> dsu !! b) = ReferTo rr

b < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
rr: nat
ww: b ≠ a
hh: default (Ancestor Unit) (<[b:=Ancestor (Unite t2 t1)]> dsu !! b) = ReferTo rr

b < length dsu
lia. }
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: default (Ancestor Unit) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) = ReferTo rr
ww: yy ≠ a
ii: yy ≠ b

rr < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
yy, rr: nat
hh: nth yy dsu (Ancestor Unit) = ReferTo rr
ww: yy ≠ a
ii: yy ≠ b

rr < length dsu
exact (h _ _ hh).
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))

2 ≤ length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))

2 ≤ length dsu
destruct dsu as [| head [| head' tail]]; simpl in *; lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ++ [b] ≠ []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nth 0 (ancestorChain dsu (length dsu) i ++ [b]) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i ++ [b]) → nth (nth _0 (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ++ [b] ≠ []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []

length (ancestorChain dsu (length dsu) i ++ [b]) = length []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []
ayw: length (ancestorChain dsu (length dsu) i ++ [b]) = length ([] : list nat)
False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []

length (ancestorChain dsu (length dsu) i ++ [b]) = length []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []

length [] = length []
reflexivity.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []
ayw: length (ancestorChain dsu (length dsu) i ++ [b]) = length ([] : list nat)

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []
ayw: length (ancestorChain dsu (length dsu) i) + length [b] = length []

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ga: ancestorChain dsu (length dsu) i ++ [b] = []
ayw: length (ancestorChain dsu (length dsu) i) + 1 = 0

False
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i ++ [b]) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

default 0 (ancestorChain dsu (length dsu) i !! 0) < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
0 < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

default 0 (ancestorChain dsu (length dsu) i !! 0) < length dsu
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
exact g2.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

0 < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ds: 0 < length (ancestorChain dsu (length dsu) i)

0 < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ds: length (ancestorChain dsu (length dsu) i) = 0
0 < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ds: 0 < length (ancestorChain dsu (length dsu) i)

0 < length (ancestorChain dsu (length dsu) i)
exact ds.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ds: length (ancestorChain dsu (length dsu) i) = 0

0 < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ds: length (ancestorChain dsu (length dsu) i) = 0
_0: ancestorChain dsu (length dsu) i = []

0 < length (ancestorChain dsu (length dsu) i)
tauto.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i ++ [b]) → nth (nth _0 (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i ++ [b])

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + length [b]

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)

nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)

nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)

nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)

nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 = a

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth a dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 = a

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
i, ja: nat
h3: ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth a dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 = a

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a

nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a

nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a

nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 = b

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth b dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 = b

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
i, ja: nat
h4: ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0) = Ancestor t4
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth b dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 = b

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

nth (nth ja (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
b ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
a ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
assumption.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

b ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b
a ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

b ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

b ≠ nth ja (ancestorChain dsu (length dsu) i) 0
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

a ≠ default 0 (ancestorChain dsu (length dsu) i !! ja)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja < length (ancestorChain dsu (length dsu) i)
g4: nth (nth ja (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i) 0)
n1: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth ja (ancestorChain dsu (length dsu) i) 0 ≠ b

a ≠ nth ja (ancestorChain dsu (length dsu) i) 0
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

default 0 ([b] !! (S ja - length (ancestorChain dsu (length dsu) i))) = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
length (ancestorChain dsu (length dsu) i) ≤ S ja
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

default 0 ([b] !! (S ja - length (ancestorChain dsu (length dsu) i))) = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

default 0 ([b] !! 0) = b
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)

length (ancestorChain dsu (length dsu) i) ≤ S ja
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = ancestor dsu (length dsu) i

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a
nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
ja < length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
exact gh.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a

ja < length (ancestorChain dsu (length dsu) i)
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a

nth (nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a

default (Ancestor Unit) (Some (ReferTo b)) = ReferTo b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a
a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a

default (Ancestor Unit) (Some (ReferTo b)) = ReferTo b
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a

a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ja: nat
k: S ja < length (ancestorChain dsu (length dsu) i) + 1
u: S ja = length (ancestorChain dsu (length dsu) i)
stp: nth (S ja) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
gh: nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0 = a
spt: nth ja (ancestorChain dsu (length dsu) i ++ [b]) 0 = a

a < length dsu
exact ha.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor (Unite t2 t1)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ajk: nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
nth (nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor (Unite t2 t1)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (length (ancestorChain dsu (length dsu) i) + length [b] - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (length (ancestorChain dsu (length dsu) i) + 1 - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

default 0 ([b] !! 0) = b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
length (ancestorChain dsu (length dsu) i) ≤ length (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

default 0 ([b] !! 0) = b
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

length (ancestorChain dsu (length dsu) i) ≤ length (ancestorChain dsu (length dsu) i)
lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ajk: nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0 = b

nth (nth (length (ancestorChain dsu (length dsu) i ++ [b]) - 1) (ancestorChain dsu (length dsu) i ++ [b]) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor (Unite t2 t1)
rewrite ajk, nth_lookup, list_lookup_insert_ne, list_lookup_insert; (easy || lia).
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i
ra: nth (length (ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i) - 1) (ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i) 0 = ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i
ra: default 0 ([b] !! 0) = ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i
ra: ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i = default 0 ([b] !! 0)

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i = a
ya: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i ++ [b])
ua: ancestorChain dsu (length dsu) i ++ [b] = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i
ra: ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length dsu) i = b

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
rewrite !insert_length, ra, nth_lookup, list_lookup_insert_ne, list_lookup_insert; (easy || lia).
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ≠ []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nth 0 (ancestorChain dsu (length dsu) i) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ≠ []
dsu: list Slot
a, b: nat
ha: a < 0
hb: b < 0
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu 0
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < 0
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 20
hs: ancestor dsu 0 i ≠ a
ht: ancestor dsu 0 i = b
g1: ancestorChain dsu 0 i ≠ []
g2: nth 0 (ancestorChain dsu 0 i) 0 < 0
g3: _0 : nat, S _0 < length (ancestorChain dsu 0 i) → nth (nth _0 (ancestorChain dsu 0 i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu 0 i) 0)

ancestorChain dsu 0 i ≠ []
dsu: list Slot
a, b, g: nat
ha: a < S g
hb: b < S g
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (S g)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < S g
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ S g
hs: ancestor dsu (S g) i ≠ a
ht: ancestor dsu (S g) i = b
g1: ancestorChain dsu (S g) i ≠ []
g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g
g3: _0 : nat, S _0 < length (ancestorChain dsu (S g) i) → nth (nth _0 (ancestorChain dsu (S g) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (S g) i) 0)
ancestorChain dsu (S g) i ≠ []
dsu: list Slot
a, b: nat
ha: a < 0
hb: b < 0
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu 0
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < 0
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 20
hs: ancestor dsu 0 i ≠ a
ht: ancestor dsu 0 i = b
g1: ancestorChain dsu 0 i ≠ []
g2: nth 0 (ancestorChain dsu 0 i) 0 < 0
g3: _0 : nat, S _0 < length (ancestorChain dsu 0 i) → nth (nth _0 (ancestorChain dsu 0 i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu 0 i) 0)

ancestorChain dsu 0 i ≠ []
dsu: list Slot
a, b: nat
ha: a < 0
hb: b < 0
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu 0
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < 0
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 20
hs: ancestor dsu 0 i ≠ a
ht: ancestor dsu 0 i = b
g1: ancestorChain dsu 0 i ≠ []
g2: nth 0 (ancestorChain dsu 0 i) 0 < 0
g3: _0 : nat, S _0 < length (ancestorChain dsu 0 i) → nth (nth _0 (ancestorChain dsu 0 i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu 0 i) 0)

[i] ≠ []
easy.
dsu: list Slot
a, b, g: nat
ha: a < S g
hb: b < S g
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (S g)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < S g
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ S g
hs: ancestor dsu (S g) i ≠ a
ht: ancestor dsu (S g) i = b
g1: ancestorChain dsu (S g) i ≠ []
g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g
g3: _0 : nat, S _0 < length (ancestorChain dsu (S g) i) → nth (nth _0 (ancestorChain dsu (S g) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (S g) i) 0)

ancestorChain dsu (S g) i ≠ []
dsu: list Slot
a, b, g: nat
ha: a < S g
hb: b < S g
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (S g)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < S g
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ S g
hs: ancestor dsu (S g) i ≠ a
ht: ancestor dsu (S g) i = b
g1: ancestorChain dsu (S g) i ≠ []
g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g
g3: _0 : nat, S _0 < length (ancestorChain dsu (S g) i) → nth (nth _0 (ancestorChain dsu (S g) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (S g) i) 0)

match nth i dsu (Ancestor Unit) with | ReferTo _0 => i :: ancestorChain dsu g _0 | Ancestor _ => [i] end ≠ []
destruct (nth i dsu (Ancestor Unit)) as [jk | jk]; easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
assumption.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
w: nth y (ancestorChain dsu (length dsu) i) 0 = a

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: Ancestor t3 = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
w: nth y (ancestorChain dsu (length dsu) i) 0 = a

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
w: nth y (ancestorChain dsu (length dsu) i) 0 = b

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: Ancestor t4 = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
w: nth y (ancestorChain dsu (length dsu) i) 0 = b

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
su: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth y (ancestorChain dsu (length dsu) i) 0 ≠ b

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
rewrite !nth_lookup, !list_lookup_insert_ne, <- !nth_lookup, su; [easy | |]; rewrite <- nth_lookup; lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth (nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor (Unite t2 t1)
rewrite ancestorEqLastAncestorChain, ht, !nth_lookup, list_lookup_insert_ne, list_lookup_insert; [easy | |]; lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i = b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
nn: ancestorChain dsu (length dsu) i = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
rewrite <- ancestorEqLastAncestorChain, <- nn, ancestorEqLastAncestorChain, ht, !nth_lookup, list_lookup_insert_ne, list_lookup_insert; (easy || lia).
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ≠ []
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nth 0 (ancestorChain dsu (length dsu) i) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

ancestorChain dsu (length dsu) i ≠ []
destruct (length dsu); try easy; simpl; destruct (nth i _ _); easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i) 0 < length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
assumption.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)

nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
g: nth y (ancestorChain dsu (length dsu) i) 0 = a

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: Ancestor t3 = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
g: nth y (ancestorChain dsu (length dsu) i) 0 = a

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a

nth y (ancestorChain dsu (length dsu) i) 0 ≠ b
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
g: nth y (ancestorChain dsu (length dsu) i) 0 = b

False
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: Ancestor t4 = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
g: nth y (ancestorChain dsu (length dsu) i) 0 = b

False
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
y: nat
u: S y < length (ancestorChain dsu (length dsu) i)
us: nth (nth y (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
n1: nth y (ancestorChain dsu (length dsu) i) 0 ≠ a
n2: nth y (ancestorChain dsu (length dsu) i) 0 ≠ b

nth (nth y (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = ReferTo (nth (S y) (ancestorChain dsu (length dsu) i) 0)
rewrite nth_lookup, !list_lookup_insert_ne; [rewrite <- nth_lookup; assumption | |]; lia.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : Tree, nth (nth (length (ancestorChain dsu (length dsu) i) - 1) (ancestorChain dsu (length dsu) i) 0) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : Tree, default (Ancestor Unit) (dsu !! ancestor dsu (length dsu) i) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)

_0 : Tree, nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
ji: match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end

_0 : Tree, nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nn: nat
ji: false

_0 : Tree, ReferTo nn = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nn: Tree
ji: true
_0 : Tree, Ancestor nn = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nn: nat
ji: false

_0 : Tree, ReferTo nn = Ancestor _0
easy.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nn: Tree
ji: true

_0 : Tree, Ancestor nn = Ancestor _0
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
g1: ancestorChain dsu (length dsu) i ≠ []
g2: nth 0 (ancestorChain dsu (length dsu) i) 0 < length dsu
g3: _0 : nat, S _0 < length (ancestorChain dsu (length dsu) i) → nth (nth _0 (ancestorChain dsu (length dsu) i) 0) dsu (Ancestor Unit) = ReferTo (nth (S _0) (ancestorChain dsu (length dsu) i) 0)
nn: Tree
ji: true

Ancestor nn = Ancestor nn
reflexivity.
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
nn: ancestorChain dsu (length dsu) i = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i

match nth (ancestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i) (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
dsu: list Slot
a, b: nat
ha: a < length dsu
hb: b < length dsu
hD: a ≠ b
t1, t2: Tree
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
t3: Tree
h3: nth a dsu (Ancestor Unit) = Ancestor t3
t4: Tree
h4: nth b dsu (Ancestor Unit) = Ancestor t4
i: nat
j: i < length dsu
als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
hL: 2 ≤ length dsu
hs: ancestor dsu (length dsu) i ≠ a
ht: ancestor dsu (length dsu) i ≠ b
ter: validChainToAncestor (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (ancestorChain dsu (length dsu) i)
nn: ancestorChain dsu (length dsu) i = ancestorChain (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) (length (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))) i

match nth (ancestor dsu (length dsu) i) dsu (Ancestor Unit) with | ReferTo _ => false | Ancestor _ => true end
apply (h1 i j). Qed.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)

withoutCyclesN (unite dsu a b) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)

withoutCyclesN (unite dsu a b) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)

withoutCyclesN (if decide (length dsu ≤ a) then dsu else if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: length dsu ≤ a

withoutCyclesN dsu (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
withoutCyclesN (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: length dsu ≤ a

withoutCyclesN dsu (length dsu)
exact h1.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a

withoutCyclesN (if decide (length dsu ≤ b) then dsu else if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: length dsu ≤ b

withoutCyclesN dsu (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
withoutCyclesN (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: length dsu ≤ b

withoutCyclesN dsu (length dsu)
exact h1.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b

withoutCyclesN (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
withoutCyclesN (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
step1: withoutCyclesN (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu)

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
step1: withoutCyclesN (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu)

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
step1: withoutCyclesN (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu)
step2: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)))

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
step1: withoutCyclesN (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu)
step2: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
exact step2.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)

withoutCyclesN (if decide (ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) then pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) else match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
withoutCyclesN match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a = ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
exact hR.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b

withoutCyclesN match nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Slot
hg: g = nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

withoutCyclesN match g with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Slot
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = g

withoutCyclesN match g with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _1 => if decide (leafCount _1 < leafCount _0) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _1 _0 (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 _1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: nat
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo g

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
withoutCyclesN match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: nat
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo g

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
exact hR.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g

withoutCyclesN match nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Slot
hg1: g1 = nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit)

withoutCyclesN match g1 with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Slot
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = g1

withoutCyclesN match g1 with | ReferTo _ => pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) | Ancestor _0 => if decide (leafCount _0 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) _0 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g _0 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) end (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: nat
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo g1

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
withoutCyclesN (if decide (leafCount g1 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: nat
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = ReferTo g1

withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
exact hR.
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1

withoutCyclesN (if decide (leafCount g1 < leafCount g) then performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a) else performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: leafCount g1 < leafCount g

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: ¬ leafCount g1 < leafCount g
withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: leafCount g1 < leafCount g

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: leafCount g1 < leafCount g
ii: _0 : Tree, nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor _0 → _1 : Tree, nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor _1 → withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) (length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (ancestor dsu (length dsu) a)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor g1
hs: leafCount g1 < leafCount g
ii: _0 : Tree, nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor _0 → _1 : Tree, nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor _1 → withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (ancestor dsu (length dsu) a)) (length dsu)

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) g1 g (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (ancestor dsu (length dsu) a)) (length dsu)
exact (ii g1 hg1 g hg).
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: ¬ leafCount g1 < leafCount g

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor g1
hs: ¬ leafCount g1 < leafCount g
ii: _0 : Tree, nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor _0 → _1 : Tree, nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (Ancestor Unit) = Ancestor _1 → withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)))

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a))) b)) (length dsu)
dsu: list Slot
a, b: nat
h: noIllegalIndices dsu
h1: withoutCyclesN dsu (length dsu)
a1: ¬ length dsu ≤ a
a2: ¬ length dsu ≤ b
hR: withoutCyclesN (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
a3: ancestor dsu (length dsu) a ≠ ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b
g: Tree
hg: nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor g
g1: Tree
hg1: nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor g1
hs: ¬ leafCount g1 < leafCount g
ii: _0 : Tree, nth (ancestor dsu (length dsu) a) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor _0 → _1 : Tree, nth (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b) (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (Ancestor Unit) = Ancestor _1 → withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)

withoutCyclesN (performMerge (pathCompress (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) g g1 (ancestor dsu (length dsu) a) (ancestor (pathCompress dsu (length dsu) a (ancestor dsu (length dsu) a)) (length dsu) b)) (length dsu)
exact (ii g hg g1 hg1). Qed.